@cntrl-site/components 1.0.97-8 → 1.0.97-9
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/index.js +15 -19
- package/dist/index.mjs +116 -120
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const a=require("react/jsx-runtime"),s=require("react"),Et=require("classnames"),b=require("./EmbedMediaFrame-C__c1jQ6.js"),qn=require("react-dom");function pm(e){return e.type==="object"&&e.version===1}const mm="ControlSlider-module__wrapper___sHEkd",gm="ControlSlider-module__hoverArrow___A-dOH",hm="ControlSlider-module__sliderItem___QQSkR",fm="ControlSlider-module__sliderImage___9hRl-",ym="ControlSlider-module__arrow___05ghY",vm="ControlSlider-module__arrowVertical___tBfVN",xm="ControlSlider-module__nextArrow___-30Yc",bm="ControlSlider-module__arrowInner___aEra3",Sm="ControlSlider-module__arrowIcon___S4ztF",wm="ControlSlider-module__arrowImg___2dwJW",$m="ControlSlider-module__mirror___brd6U",Cm="ControlSlider-module__pagination___bicLF",Tm="ControlSlider-module__paginationInner___bT-P-",Im="ControlSlider-module__paginationVertical___zYqKw",Lm="ControlSlider-module__paginationItem___nTRbk",Pm="ControlSlider-module__dot___p1Qun",Mm="ControlSlider-module__activeDot___LHFaj",Em="ControlSlider-module__paginationInsideBottom___R3FWn",Rm="ControlSlider-module__paginationInsideTop___V-qb-",km="ControlSlider-module__paginationOutsideBottom___14w8D",Am="ControlSlider-module__paginationOutsideTop___SCLqB",Fm="ControlSlider-module__paginationInsideLeft___yOBRZ",Nm="ControlSlider-module__paginationInsideRight___Rtt3o",_m="ControlSlider-module__paginationOutsideLeft___lahaw",Hm="ControlSlider-module__paginationOutsideRight___EtuQa",Wm="ControlSlider-module__imgWrapper___UjEgB",Om="ControlSlider-module__captionBlock___dJ6-j",Dm="ControlSlider-module__captionTextWrapper___HFlpf",zm="ControlSlider-module__captionText___uGBVc",Bm="ControlSlider-module__active___WZK4G",jm="ControlSlider-module__withPointerEvents___t-18M",Vm="ControlSlider-module__topLeftAlignment___zjnGM",Gm="ControlSlider-module__topCenterAlignment___gD1xW",Xm="ControlSlider-module__topRightAlignment___NMapS",Um="ControlSlider-module__middleLeftAlignment___OnUrY",qm="ControlSlider-module__middleCenterAlignment___Tdkl0",Km="ControlSlider-module__middleRightAlignment___wEbfX",Ym="ControlSlider-module__bottomLeftAlignment___cTP2-",Qm="ControlSlider-module__bottomCenterAlignment___c54fB",Zm="ControlSlider-module__bottomRightAlignment___kEwrz",Jm="ControlSlider-module__clickOverlay___DZA28",eg="ControlSlider-module__contain___pLyq7",tg="ControlSlider-module__cover___KdDat",Mt={wrapper:mm,hoverArrow:gm,sliderItem:hm,sliderImage:fm,arrow:ym,arrowVertical:vm,nextArrow:xm,arrowInner:bm,arrowIcon:Sm,arrowImg:wm,mirror:$m,pagination:Cm,paginationInner:Tm,paginationVertical:Im,paginationItem:Lm,dot:Pm,activeDot:Mm,paginationInsideBottom:Em,paginationInsideTop:Rm,paginationOutsideBottom:km,paginationOutsideTop:Am,paginationInsideLeft:Fm,paginationInsideRight:Nm,paginationOutsideLeft:_m,paginationOutsideRight:Hm,imgWrapper:Wm,captionBlock:Om,captionTextWrapper:Dm,captionText:zm,active:Bm,withPointerEvents:jm,topLeftAlignment:Vm,topCenterAlignment:Gm,topRightAlignment:Xm,middleLeftAlignment:Um,middleCenterAlignment:qm,middleRightAlignment:Km,bottomLeftAlignment:Ym,bottomCenterAlignment:Qm,bottomRightAlignment:Zm,clickOverlay:Jm,contain:eg,cover:tg};function ng(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 ig(e,t,n){return t&&ng(e.prototype,t),Object.defineProperty(e,"prototype",{writable:!1}),e}var ic="(prefers-reduced-motion: reduce)",go=1,og=2,Co=3,Wo=4,Cr=5,la=6,ya=7,rg={CREATED:go,MOUNTED:og,IDLE:Co,MOVING:Wo,SCROLLING:Cr,DRAGGING:la,DESTROYED:ya};function ci(e){e.length=0}function Ai(e,t,n){return Array.prototype.slice.call(e,t,n)}function tn(e){return e.bind.apply(e,[null].concat(Ai(arguments,1)))}var pu=setTimeout,_s=function(){};function oc(e){return requestAnimationFrame(e)}function Ea(e,t){return typeof t===e}function dr(e){return!ml(e)&&Ea("object",e)}var pl=Array.isArray,mu=tn(Ea,"function"),Pi=tn(Ea,"string"),Tr=tn(Ea,"undefined");function ml(e){return e===null}function gu(e){try{return e instanceof(e.ownerDocument.defaultView||window).HTMLElement}catch{return!1}}function Ir(e){return pl(e)?e:[e]}function kn(e,t){Ir(e).forEach(t)}function gl(e,t){return e.indexOf(t)>-1}function ca(e,t){return e.push.apply(e,Ir(t)),e}function oi(e,t,n){e&&kn(t,function(i){i&&e.classList[n?"add":"remove"](i)})}function Gn(e,t){oi(e,Pi(t)?t.split(" "):t,!0)}function Lr(e,t){kn(t,e.appendChild.bind(e))}function hl(e,t){kn(e,function(n){var i=(t||n).parentNode;i&&i.insertBefore(n,t)})}function ur(e,t){return gu(e)&&(e.msMatchesSelector||e.matches).call(e,t)}function hu(e,t){var n=e?Ai(e.children):[];return t?n.filter(function(i){return ur(i,t)}):n}function Pr(e,t){return t?hu(e,t)[0]:e.firstElementChild}var pr=Object.keys;function qi(e,t,n){return e&&(n?pr(e).reverse():pr(e)).forEach(function(i){i!=="__proto__"&&t(e[i],i)}),e}function mr(e){return Ai(arguments,1).forEach(function(t){qi(t,function(n,i){e[i]=t[i]})}),e}function Ci(e){return Ai(arguments,1).forEach(function(t){qi(t,function(n,i){pl(n)?e[i]=n.slice():dr(n)?e[i]=Ci({},dr(e[i])?e[i]:{},n):e[i]=n})}),e}function rc(e,t){kn(t||pr(e),function(n){delete e[n]})}function Xn(e,t){kn(e,function(n){kn(t,function(i){n&&n.removeAttribute(i)})})}function Vt(e,t,n){dr(t)?qi(t,function(i,o){Vt(e,o,i)}):kn(e,function(i){ml(n)||n===""?Xn(i,t):i.setAttribute(t,String(n))})}function xo(e,t,n){var i=document.createElement(e);return t&&(Pi(t)?Gn(i,t):Vt(i,t)),n&&Lr(n,i),i}function _n(e,t,n){if(Tr(n))return getComputedStyle(e)[t];ml(n)||(e.style[t]=""+n)}function gr(e,t){_n(e,"display",t)}function fu(e){e.setActive&&e.setActive()||e.focus({preventScroll:!0})}function Hn(e,t){return e.getAttribute(t)}function ac(e,t){return e&&e.classList.contains(t)}function Pn(e){return e.getBoundingClientRect()}function Yi(e){kn(e,function(t){t&&t.parentNode&&t.parentNode.removeChild(t)})}function yu(e){return Pr(new DOMParser().parseFromString(e,"text/html").body)}function ni(e,t){e.preventDefault(),t&&(e.stopPropagation(),e.stopImmediatePropagation())}function vu(e,t){return e&&e.querySelector(t)}function fl(e,t){return t?Ai(e.querySelectorAll(t)):[]}function ri(e,t){oi(e,t,!1)}function Hs(e){return e.timeStamp}function _i(e){return Pi(e)?e:e?e+"px":""}var Mr="splide",yl="data-"+Mr;function ar(e,t){if(!e)throw new Error("["+Mr+"] "+(t||""))}var Mi=Math.min,va=Math.max,xa=Math.floor,hr=Math.ceil,xn=Math.abs;function xu(e,t,n){return xn(e-t)<n}function da(e,t,n,i){var o=Mi(t,n),r=va(t,n);return i?o<e&&e<r:o<=e&&e<=r}function co(e,t,n){var i=Mi(t,n),o=va(t,n);return Mi(va(i,e),o)}function Ws(e){return+(e>0)-+(e<0)}function Os(e,t){return kn(t,function(n){e=e.replace("%s",""+n)}),e}function vl(e){return e<10?"0"+e:""+e}var sc={};function ag(e){return""+e+vl(sc[e]=(sc[e]||0)+1)}function bu(){var e=[];function t(l,c,d,u){o(l,c,function(p,y,S){var m="addEventListener"in p,h=m?p.removeEventListener.bind(p,y,d,u):p.removeListener.bind(p,d);m?p.addEventListener(y,d,u):p.addListener(d),e.push([p,y,S,d,h])})}function n(l,c,d){o(l,c,function(u,p,y){e=e.filter(function(S){return S[0]===u&&S[1]===p&&S[2]===y&&(!d||S[3]===d)?(S[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){kn(l,function(u){u&&kn(c,function(p){p.split(" ").forEach(function(y){var S=y.split(".");d(u,S[0],S[1])})})})}function r(){e.forEach(function(l){l[4]()}),ci(e)}return{bind:t,unbind:n,dispatch:i,destroy:r}}var Fi="mounted",Ds="ready",di="move",Oo="moved",xl="click",Su="active",wu="inactive",$u="visible",Cu="hidden",ln="refresh",hn="updated",To="resize",Ra="resized",Tu="drag",Iu="dragging",Lu="dragged",ka="scroll",Ji="scrolled",sg="overflow",bl="destroy",Pu="arrows:mounted",Mu="arrows:updated",Eu="pagination:mounted",Ru="pagination:updated",Sl="navigation:mounted",wl="autoplay:play",ku="autoplay:playing",$l="autoplay:pause",Cl="lazyload:loaded",Au="sk",Fu="sh",ba="ei";function an(e){var t=e?e.event.bus:document.createDocumentFragment(),n=bu();function i(r,l){n.bind(t,Ir(r).join(" "),function(c){l.apply(l,pl(c.detail)?c.detail:[])})}function o(r){n.dispatch(t,r,Ai(arguments,1))}return e&&e.event.on(bl,n.destroy),mr(n,{bus:t,on:i,off:tn(n.unbind,t),emit:o})}function Aa(e,t,n,i){var o=Date.now,r,l=0,c,d=!0,u=0;function p(){if(!d){if(l=e?Mi((o()-r)/e,1):1,n&&n(l),l>=1&&(t(),r=o(),i&&++u>=i))return S();c=oc(p)}}function y(F){F||h(),r=o()-(F?l*e:0),d=!1,c=oc(p)}function S(){d=!0}function m(){r=o(),l=0,n&&n(l)}function h(){c&&cancelAnimationFrame(c),l=0,c=0,d=!0}function x(F){e=F}function w(){return d}return{start:y,rewind:m,pause:S,cancel:h,set:x,isPaused:w}}function lg(e){var t=e;function n(o){t=o}function i(o){return gl(Ir(o),t)}return{set:n,is:i}}function cg(e,t){var n=Aa(0,e,null,1);return function(){n.isPaused()&&n.start()}}function dg(e,t,n){var i=e.state,o=n.breakpoints||{},r=n.reducedMotion||{},l=bu(),c=[];function d(){var h=n.mediaQuery==="min";pr(o).sort(function(x,w){return h?+x-+w:+w-+x}).forEach(function(x){p(o[x],"("+(h?"min":"max")+"-width:"+x+"px)")}),p(r,ic),y()}function u(h){h&&l.destroy()}function p(h,x){var w=matchMedia(x);l.bind(w,"change",y),c.push([h,w])}function y(){var h=i.is(ya),x=n.direction,w=c.reduce(function(F,v){return Ci(F,v[1].matches?v[0]:{})},{});rc(n),m(w),n.destroy?e.destroy(n.destroy==="completely"):h?(u(!0),e.mount()):x!==n.direction&&e.refresh()}function S(h){matchMedia(ic).matches&&(h?Ci(n,r):rc(n,pr(r)))}function m(h,x,w){Ci(n,h),x&&Ci(Object.getPrototypeOf(n),h),(w||!i.is(go))&&e.emit(hn,n)}return{setup:d,destroy:u,reduce:S,set:m}}var Fa="Arrow",Na=Fa+"Left",_a=Fa+"Right",Nu=Fa+"Up",_u=Fa+"Down",lc="rtl",Ha="ttb",Ka={width:["height"],left:["top","right"],right:["bottom","left"],x:["y"],X:["Y"],Y:["X"],ArrowLeft:[Nu,_a],ArrowRight:[_u,Na]};function ug(e,t,n){function i(r,l,c){c=c||n.direction;var d=c===lc&&!l?1:c===Ha?0:-1;return Ka[r]&&Ka[r][d]||r.replace(/width|left|right/i,function(u,p){var y=Ka[u.toLowerCase()][d]||u;return p>0?y.charAt(0).toUpperCase()+y.slice(1):y})}function o(r){return r*(n.direction===lc?1:-1)}return{resolve:i,orient:o}}var ai="role",bo="tabindex",pg="disabled",Wn="aria-",Er=Wn+"controls",Hu=Wn+"current",cc=Wn+"selected",En=Wn+"label",Tl=Wn+"labelledby",Wu=Wn+"hidden",Il=Wn+"orientation",fr=Wn+"roledescription",dc=Wn+"live",uc=Wn+"busy",pc=Wn+"atomic",Ll=[ai,bo,pg,Er,Hu,En,Tl,Wu,Il,fr],Kn=Mr+"__",Ni="is-",Ya=Mr,mc=Kn+"track",mg=Kn+"list",Wa=Kn+"slide",Ou=Wa+"--clone",gg=Wa+"__container",Pl=Kn+"arrows",Oa=Kn+"arrow",Du=Oa+"--prev",zu=Oa+"--next",Da=Kn+"pagination",Bu=Da+"__page",hg=Kn+"progress",fg=hg+"__bar",yg=Kn+"toggle",vg=Kn+"spinner",xg=Kn+"sr",bg=Ni+"initialized",Qi=Ni+"active",ju=Ni+"prev",Vu=Ni+"next",zs=Ni+"visible",Bs=Ni+"loading",Gu=Ni+"focus-in",Xu=Ni+"overflow",Sg=[Qi,zs,ju,Vu,Bs,Gu,Xu],wg={slide:Wa,clone:Ou,arrows:Pl,arrow:Oa,prev:Du,next:zu,pagination:Da,page:Bu,spinner:vg};function $g(e,t){if(mu(e.closest))return e.closest(t);for(var n=e;n&&n.nodeType===1&&!ur(n,t);)n=n.parentElement;return n}var Cg=5,gc=200,Uu="touchstart mousedown",Qa="touchmove mousemove",Za="touchend touchcancel mouseup click";function Tg(e,t,n){var i=an(e),o=i.on,r=i.bind,l=e.root,c=n.i18n,d={},u=[],p=[],y=[],S,m,h;function x(){P(),M(),v()}function w(){o(ln,F),o(ln,x),o(hn,v),r(document,Uu+" keydown",function(j){h=j.type==="keydown"},{capture:!0}),r(l,"focusin",function(){oi(l,Gu,!!h)})}function F(j){var N=Ll.concat("style");ci(u),ri(l,p),ri(S,y),Xn([S,m],N),Xn(l,j?N:["style",fr])}function v(){ri(l,p),ri(S,y),p=X(Ya),y=X(mc),Gn(l,p),Gn(S,y),Vt(l,En,n.label),Vt(l,Tl,n.labelledby)}function P(){S=K("."+mc),m=Pr(S,"."+mg),ar(S&&m,"A track/list element is missing."),ca(u,hu(m,"."+Wa+":not(."+Ou+")")),qi({arrows:Pl,pagination:Da,prev:Du,next:zu,bar:fg,toggle:yg},function(j,N){d[N]=K("."+j)}),mr(d,{root:l,track:S,list:m,slides:u})}function M(){var j=l.id||ag(Mr),N=n.role;l.id=j,S.id=S.id||j+"-track",m.id=m.id||j+"-list",!Hn(l,ai)&&l.tagName!=="SECTION"&&N&&Vt(l,ai,N),Vt(l,fr,c.carousel),Vt(m,ai,"presentation")}function K(j){var N=vu(l,j);return N&&$g(N,"."+Ya)===l?N:void 0}function X(j){return[j+"--"+n.type,j+"--"+n.direction,n.drag&&j+"--draggable",n.isNavigation&&j+"--nav",j===Ya&&Qi]}return mr(d,{setup:x,mount:w,destroy:F})}var Io="slide",Do="loop",Rr="fade";function Ig(e,t,n,i){var o=an(e),r=o.on,l=o.emit,c=o.bind,d=e.Components,u=e.root,p=e.options,y=p.isNavigation,S=p.updateOnMove,m=p.i18n,h=p.pagination,x=p.slideFocus,w=d.Direction.resolve,F=Hn(i,"style"),v=Hn(i,En),P=n>-1,M=Pr(i,"."+gg),K;function X(){P||(i.id=u.id+"-slide"+vl(t+1),Vt(i,ai,h?"tabpanel":"group"),Vt(i,fr,m.slide),Vt(i,En,v||Os(m.slideLabel,[t+1,e.length]))),j()}function j(){c(i,"click",tn(l,xl,U)),c(i,"keydown",tn(l,Au,U)),r([Oo,Fu,Ji],L),r(Sl,_),S&&r(di,T)}function N(){K=!0,o.destroy(),ri(i,Sg),Xn(i,Ll),Vt(i,"style",F),Vt(i,En,v||"")}function _(){var E=e.splides.map(function(f){var Q=f.splide.Components.Slides.getAt(t);return Q?Q.slide.id:""}).join(" ");Vt(i,En,Os(m.slideX,(P?n:t)+1)),Vt(i,Er,E),Vt(i,ai,x?"button":""),x&&Xn(i,fr)}function T(){K||L()}function L(){if(!K){var E=e.index;Y(),R(),oi(i,ju,t===E-1),oi(i,Vu,t===E+1)}}function Y(){var E=$();E!==ac(i,Qi)&&(oi(i,Qi,E),Vt(i,Hu,y&&E||""),l(E?Su:wu,U))}function R(){var E=G(),f=!E&&(!$()||P);if(e.state.is([Wo,Cr])||Vt(i,Wu,f||""),Vt(fl(i,p.focusableNodes||""),bo,f?-1:""),x&&Vt(i,bo,f?-1:0),E!==ac(i,zs)&&(oi(i,zs,E),l(E?$u:Cu,U)),!E&&document.activeElement===i){var Q=d.Slides.getAt(e.index);Q&&fu(Q.slide)}}function I(E,f,Q){_n(Q&&M||i,E,f)}function $(){var E=e.index;return E===t||p.cloneStatus&&E===n}function G(){if(e.is(Rr))return $();var E=Pn(d.Elements.track),f=Pn(i),Q=w("left",!0),q=w("right",!0);return xa(E[Q])<=hr(f[Q])&&xa(f[q])<=hr(E[q])}function O(E,f){var Q=xn(E-t);return!P&&(p.rewind||e.is(Do))&&(Q=Mi(Q,e.length-Q)),Q<=f}var U={index:t,slideIndex:n,slide:i,container:M,isClone:P,mount:X,destroy:N,update:L,style:I,isWithin:O};return U}function Lg(e,t,n){var i=an(e),o=i.on,r=i.emit,l=i.bind,c=t.Elements,d=c.slides,u=c.list,p=[];function y(){S(),o(ln,m),o(ln,S)}function S(){d.forEach(function(L,Y){x(L,Y,-1)})}function m(){K(function(L){L.destroy()}),ci(p)}function h(){K(function(L){L.update()})}function x(L,Y,R){var I=Ig(e,Y,R,L);I.mount(),p.push(I),p.sort(function($,G){return $.index-G.index})}function w(L){return L?X(function(Y){return!Y.isClone}):p}function F(L){var Y=t.Controller,R=Y.toIndex(L),I=Y.hasFocus()?1:n.perPage;return X(function($){return da($.index,R,R+I-1)})}function v(L){return X(L)[0]}function P(L,Y){kn(L,function(R){if(Pi(R)&&(R=yu(R)),gu(R)){var I=d[Y];I?hl(R,I):Lr(u,R),Gn(R,n.classes.slide),N(R,tn(r,To))}}),r(ln)}function M(L){Yi(X(L).map(function(Y){return Y.slide})),r(ln)}function K(L,Y){w(Y).forEach(L)}function X(L){return p.filter(mu(L)?L:function(Y){return Pi(L)?ur(Y.slide,L):gl(Ir(L),Y.index)})}function j(L,Y,R){K(function(I){I.style(L,Y,R)})}function N(L,Y){var R=fl(L,"img"),I=R.length;I?R.forEach(function($){l($,"load error",function(){--I||Y()})}):Y()}function _(L){return L?d.length:p.length}function T(){return p.length>n.perPage}return{mount:y,destroy:m,update:h,register:x,get:w,getIn:F,getAt:v,add:P,remove:M,forEach:K,filter:X,style:j,getLength:_,isEnough:T}}function Pg(e,t,n){var i=an(e),o=i.on,r=i.bind,l=i.emit,c=t.Slides,d=t.Direction.resolve,u=t.Elements,p=u.root,y=u.track,S=u.list,m=c.getAt,h=c.style,x,w,F;function v(){P(),r(window,"resize load",cg(tn(l,To))),o([hn,ln],P),o(To,M)}function P(){x=n.direction===Ha,_n(p,"maxWidth",_i(n.width)),_n(y,d("paddingLeft"),K(!1)),_n(y,d("paddingRight"),K(!0)),M(!0)}function M(U){var E=Pn(p);(U||w.width!==E.width||w.height!==E.height)&&(_n(y,"height",X()),h(d("marginRight"),_i(n.gap)),h("width",N()),h("height",_(),!0),w=E,l(Ra),F!==(F=O())&&(oi(p,Xu,F),l(sg,F)))}function K(U){var E=n.padding,f=d(U?"right":"left");return E&&_i(E[f]||(dr(E)?0:E))||"0px"}function X(){var U="";return x&&(U=j(),ar(U,"height or heightRatio is missing."),U="calc("+U+" - "+K(!1)+" - "+K(!0)+")"),U}function j(){return _i(n.height||Pn(S).width*n.heightRatio)}function N(){return n.autoWidth?null:_i(n.fixedWidth)||(x?"":T())}function _(){return _i(n.fixedHeight)||(x?n.autoHeight?null:T():j())}function T(){var U=_i(n.gap);return"calc((100%"+(U&&" + "+U)+")/"+(n.perPage||1)+(U&&" - "+U)+")"}function L(){return Pn(S)[d("width")]}function Y(U,E){var f=m(U||0);return f?Pn(f.slide)[d("width")]+(E?0:$()):0}function R(U,E){var f=m(U);if(f){var Q=Pn(f.slide)[d("right")],q=Pn(S)[d("left")];return xn(Q-q)+(E?0:$())}return 0}function I(U){return R(e.length-1)-R(0)+Y(0,U)}function $(){var U=m(0);return U&&parseFloat(_n(U.slide,d("marginRight")))||0}function G(U){return parseFloat(_n(y,d("padding"+(U?"Right":"Left"))))||0}function O(){return e.is(Rr)||I(!0)>L()}return{mount:v,resize:M,listSize:L,slideSize:Y,sliderSize:I,totalSize:R,getPadding:G,isOverflow:O}}var Mg=2;function Eg(e,t,n){var i=an(e),o=i.on,r=t.Elements,l=t.Slides,c=t.Direction.resolve,d=[],u;function p(){o(ln,y),o([hn,To],m),(u=w())&&(h(u),t.Layout.resize(!0))}function y(){S(),p()}function S(){Yi(d),ci(d),i.destroy()}function m(){var F=w();u!==F&&(u<F||!F)&&i.emit(ln)}function h(F){var v=l.get().slice(),P=v.length;if(P){for(;v.length<F;)ca(v,v);ca(v.slice(-F),v.slice(0,F)).forEach(function(M,K){var X=K<F,j=x(M.slide,K);X?hl(j,v[0].slide):Lr(r.list,j),ca(d,j),l.register(j,K-F+(X?0:P),M.index)})}}function x(F,v){var P=F.cloneNode(!0);return Gn(P,n.classes.clone),P.id=e.root.id+"-clone"+vl(v+1),P}function w(){var F=n.clones;if(!e.is(Do))F=0;else if(Tr(F)){var v=n[c("fixedWidth")]&&t.Layout.slideSize(0),P=v&&hr(Pn(r.track)[c("width")]/v);F=P||n[c("autoWidth")]&&e.length||n.perPage*Mg}return F}return{mount:p,destroy:S}}function Rg(e,t,n){var i=an(e),o=i.on,r=i.emit,l=e.state.set,c=t.Layout,d=c.slideSize,u=c.getPadding,p=c.totalSize,y=c.listSize,S=c.sliderSize,m=t.Direction,h=m.resolve,x=m.orient,w=t.Elements,F=w.list,v=w.track,P;function M(){P=t.Transition,o([Fi,Ra,hn,ln],K)}function K(){t.Controller.isBusy()||(t.Scroll.cancel(),j(e.index),t.Slides.update())}function X(f,Q,q,pe){f!==Q&&U(f>q)&&(L(),N(T(I(),f>q),!0)),l(Wo),r(di,Q,q,f),P.start(Q,function(){l(Co),r(Oo,Q,q,f),pe&&pe()})}function j(f){N(R(f,!0))}function N(f,Q){if(!e.is(Rr)){var q=Q?f:_(f);_n(F,"transform","translate"+h("X")+"("+q+"px)"),f!==q&&r(Fu)}}function _(f){if(e.is(Do)){var Q=Y(f),q=Q>t.Controller.getEnd(),pe=Q<0;(pe||q)&&(f=T(f,q))}return f}function T(f,Q){var q=f-O(Q),pe=S();return f-=x(pe*(hr(xn(q)/pe)||1))*(Q?1:-1),f}function L(){N(I(),!0),P.cancel()}function Y(f){for(var Q=t.Slides.get(),q=0,pe=1/0,k=0;k<Q.length;k++){var me=Q[k].index,C=xn(R(me,!0)-f);if(C<=pe)pe=C,q=me;else break}return q}function R(f,Q){var q=x(p(f-1)-G(f));return Q?$(q):q}function I(){var f=h("left");return Pn(F)[f]-Pn(v)[f]+x(u(!1))}function $(f){return n.trimSpace&&e.is(Io)&&(f=co(f,0,x(S(!0)-y()))),f}function G(f){var Q=n.focus;return Q==="center"?(y()-d(f,!0))/2:+Q*d(f)||0}function O(f){return R(f?t.Controller.getEnd():0,!!n.trimSpace)}function U(f){var Q=x(T(I(),f));return f?Q>=0:Q<=F[h("scrollWidth")]-Pn(v)[h("width")]}function E(f,Q){Q=Tr(Q)?I():Q;var q=f!==!0&&x(Q)<x(O(!1)),pe=f!==!1&&x(Q)>x(O(!0));return q||pe}return{mount:M,move:X,jump:j,translate:N,shift:T,cancel:L,toIndex:Y,toPosition:R,getPosition:I,getLimit:O,exceededLimit:E,reposition:K}}function kg(e,t,n){var i=an(e),o=i.on,r=i.emit,l=t.Move,c=l.getPosition,d=l.getLimit,u=l.toPosition,p=t.Slides,y=p.isEnough,S=p.getLength,m=n.omitEnd,h=e.is(Do),x=e.is(Io),w=tn(I,!1),F=tn(I,!0),v=n.start||0,P,M=v,K,X,j;function N(){_(),o([hn,ln,ba],_),o(Ra,T)}function _(){K=S(!0),X=n.perMove,j=n.perPage,P=U();var C=co(v,0,m?P:K-1);C!==v&&(v=C,l.reposition())}function T(){P!==U()&&r(ba)}function L(C,ue,te){if(!me()){var fe=R(C),Pe=O(fe);Pe>-1&&(ue||Pe!==v)&&(q(Pe),l.move(fe,Pe,M,te))}}function Y(C,ue,te,fe){t.Scroll.scroll(C,ue,te,function(){var Pe=O(l.toIndex(c()));q(m?Mi(Pe,P):Pe),fe&&fe()})}function R(C){var ue=v;if(Pi(C)){var te=C.match(/([+\-<>])(\d+)?/)||[],fe=te[1],Pe=te[2];fe==="+"||fe==="-"?ue=$(v+ +(""+fe+(+Pe||1)),v):fe===">"?ue=Pe?E(+Pe):w(!0):fe==="<"&&(ue=F(!0))}else ue=h?C:co(C,0,P);return ue}function I(C,ue){var te=X||(k()?1:j),fe=$(v+te*(C?-1:1),v,!(X||k()));return fe===-1&&x&&!xu(c(),d(!C),1)?C?0:P:ue?fe:O(fe)}function $(C,ue,te){if(y()||k()){var fe=G(C);fe!==C&&(ue=C,C=fe,te=!1),C<0||C>P?!X&&(da(0,C,ue,!0)||da(P,ue,C,!0))?C=E(f(C)):h?C=te?C<0?-(K%j||j):K:C:n.rewind?C=C<0?P:0:C=-1:te&&C!==ue&&(C=E(f(ue)+(C<ue?-1:1)))}else C=-1;return C}function G(C){if(x&&n.trimSpace==="move"&&C!==v)for(var ue=c();ue===u(C,!0)&&da(C,0,e.length-1,!n.rewind);)C<v?--C:++C;return C}function O(C){return h?(C+K)%K||0:C}function U(){for(var C=K-(k()||h&&X?1:j);m&&C-- >0;)if(u(K-1,!0)!==u(C,!0)){C++;break}return co(C,0,K-1)}function E(C){return co(k()?C:j*C,0,P)}function f(C){return k()?Mi(C,P):xa((C>=P?K-1:C)/j)}function Q(C){var ue=l.toIndex(C);return x?co(ue,0,P):ue}function q(C){C!==v&&(M=v,v=C)}function pe(C){return C?M:v}function k(){return!Tr(n.focus)||n.isNavigation}function me(){return e.state.is([Wo,Cr])&&!!n.waitForTransition}return{mount:N,go:L,scroll:Y,getNext:w,getPrev:F,getAdjacent:I,getEnd:U,setIndex:q,getIndex:pe,toIndex:E,toPage:f,toDest:Q,hasFocus:k,isBusy:me}}var Ag="http://www.w3.org/2000/svg",Fg="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",Hr=40;function Ng(e,t,n){var i=an(e),o=i.on,r=i.bind,l=i.emit,c=n.classes,d=n.i18n,u=t.Elements,p=t.Controller,y=u.arrows,S=u.track,m=y,h=u.prev,x=u.next,w,F,v={};function P(){K(),o(hn,M)}function M(){X(),P()}function K(){var Y=n.arrows;Y&&!(h&&x)&&_(),h&&x&&(mr(v,{prev:h,next:x}),gr(m,Y?"":"none"),Gn(m,F=Pl+"--"+n.direction),Y&&(j(),L(),Vt([h,x],Er,S.id),l(Pu,h,x)))}function X(){i.destroy(),ri(m,F),w?(Yi(y?[h,x]:m),h=x=null):Xn([h,x],Ll)}function j(){o([Fi,Oo,ln,Ji,ba],L),r(x,"click",tn(N,">")),r(h,"click",tn(N,"<"))}function N(Y){p.go(Y,!0)}function _(){m=y||xo("div",c.arrows),h=T(!0),x=T(!1),w=!0,Lr(m,[h,x]),!y&&hl(m,S)}function T(Y){var R='<button class="'+c.arrow+" "+(Y?c.prev:c.next)+'" type="button"><svg xmlns="'+Ag+'" viewBox="0 0 '+Hr+" "+Hr+'" width="'+Hr+'" height="'+Hr+'" focusable="false"><path d="'+(n.arrowPath||Fg)+'" />';return yu(R)}function L(){if(h&&x){var Y=e.index,R=p.getPrev(),I=p.getNext(),$=R>-1&&Y<R?d.last:d.prev,G=I>-1&&Y>I?d.first:d.next;h.disabled=R<0,x.disabled=I<0,Vt(h,En,$),Vt(x,En,G),l(Mu,h,x,R,I)}}return{arrows:v,mount:P,destroy:X,update:L}}var _g=yl+"-interval";function Hg(e,t,n){var i=an(e),o=i.on,r=i.bind,l=i.emit,c=Aa(n.interval,e.go.bind(e,">"),j),d=c.isPaused,u=t.Elements,p=t.Elements,y=p.root,S=p.toggle,m=n.autoplay,h,x,w=m==="pause";function F(){m&&(v(),S&&Vt(S,Er,u.track.id),w||P(),X())}function v(){n.pauseOnHover&&r(y,"mouseenter mouseleave",function(_){h=_.type==="mouseenter",K()}),n.pauseOnFocus&&r(y,"focusin focusout",function(_){x=_.type==="focusin",K()}),S&&r(S,"click",function(){w?P():M(!0)}),o([di,ka,ln],c.rewind),o(di,N)}function P(){d()&&t.Slides.isEnough()&&(c.start(!n.resetProgress),x=h=w=!1,X(),l(wl))}function M(_){_===void 0&&(_=!0),w=!!_,X(),d()||(c.pause(),l($l))}function K(){w||(h||x?M(!1):P())}function X(){S&&(oi(S,Qi,!w),Vt(S,En,n.i18n[w?"play":"pause"]))}function j(_){var T=u.bar;T&&_n(T,"width",_*100+"%"),l(ku,_)}function N(_){var T=t.Slides.getAt(_);c.set(T&&+Hn(T.slide,_g)||n.interval)}return{mount:F,destroy:c.cancel,play:P,pause:M,isPaused:d}}function Wg(e,t,n){var i=an(e),o=i.on;function r(){n.cover&&(o(Cl,tn(c,!0)),o([Fi,hn,ln],tn(l,!0)))}function l(d){t.Slides.forEach(function(u){var p=Pr(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),gr(u,d?"none":"")}return{mount:r,destroy:tn(l,!1)}}var Og=10,Dg=600,zg=.6,Bg=1.5,jg=800;function Vg(e,t,n){var i=an(e),o=i.on,r=i.emit,l=e.state.set,c=t.Move,d=c.getPosition,u=c.getLimit,p=c.exceededLimit,y=c.translate,S=e.is(Io),m,h,x=1;function w(){o(di,M),o([hn,ln],K)}function F(j,N,_,T,L){var Y=d();if(M(),_&&(!S||!p())){var R=t.Layout.sliderSize(),I=Ws(j)*R*xa(xn(j)/R)||0;j=c.toPosition(t.Controller.toDest(j%R))+I}var $=xu(Y,j,1);x=1,N=$?0:N||va(xn(j-Y)/Bg,jg),h=T,m=Aa(N,v,tn(P,Y,j,L),1),l(Cr),r(ka),m.start()}function v(){l(Co),h&&h(),r(Ji)}function P(j,N,_,T){var L=d(),Y=j+(N-j)*X(T),R=(Y-L)*x;y(L+R),S&&!_&&p()&&(x*=zg,xn(R)<Og&&F(u(p(!0)),Dg,!1,h,!0))}function M(){m&&m.cancel()}function K(){m&&!m.isPaused()&&(M(),v())}function X(j){var N=n.easingFunc;return N?N(j):1-Math.pow(1-j,4)}return{mount:w,destroy:M,scroll:F,cancel:K}}var uo={passive:!1,capture:!0};function Gg(e,t,n){var i=an(e),o=i.on,r=i.emit,l=i.bind,c=i.unbind,d=e.state,u=t.Move,p=t.Scroll,y=t.Controller,S=t.Elements.track,m=t.Media.reduce,h=t.Direction,x=h.resolve,w=h.orient,F=u.getPosition,v=u.exceededLimit,P,M,K,X,j,N=!1,_,T,L;function Y(){l(S,Qa,_s,uo),l(S,Za,_s,uo),l(S,Uu,I,uo),l(S,"click",O,{capture:!0}),l(S,"dragstart",ni),o([Fi,hn],R)}function R(){var V=n.drag;we(!V),X=V==="free"}function I(V){if(_=!1,!T){var ie=Pe(V);fe(V.target)&&(ie||!V.button)&&(y.isBusy()?ni(V,!0):(L=ie?S:window,j=d.is([Wo,Cr]),K=null,l(L,Qa,$,uo),l(L,Za,G,uo),u.cancel(),p.cancel(),U(V)))}}function $(V){if(d.is(la)||(d.set(la),r(Tu)),V.cancelable)if(j){u.translate(P+te(k(V)));var ie=me(V)>gc,oe=N!==(N=v());(ie||oe)&&U(V),_=!0,r(Iu),ni(V)}else Q(V)&&(j=f(V),ni(V))}function G(V){d.is(la)&&(d.set(Co),r(Lu)),j&&(E(V),ni(V)),c(L,Qa,$),c(L,Za,G),j=!1}function O(V){!T&&_&&ni(V,!0)}function U(V){K=M,M=V,P=F()}function E(V){var ie=q(V),oe=pe(ie),le=n.rewind&&n.rewindByDrag;m(!1),X?y.scroll(oe,0,n.snap):e.is(Rr)?y.go(w(Ws(ie))<0?le?"<":"-":le?">":"+"):e.is(Io)&&N&&le?y.go(v(!0)?">":"<"):y.go(y.toDest(oe),!0),m(!0)}function f(V){var ie=n.dragMinThreshold,oe=dr(ie),le=oe&&ie.mouse||0,ve=(oe?ie.touch:+ie)||10;return xn(k(V))>(Pe(V)?ve:le)}function Q(V){return xn(k(V))>xn(k(V,!0))}function q(V){if(e.is(Do)||!N){var ie=me(V);if(ie&&ie<gc)return k(V)/ie}return 0}function pe(V){return F()+Ws(V)*Mi(xn(V)*(n.flickPower||600),X?1/0:t.Layout.listSize()*(n.flickMaxPages||1))}function k(V,ie){return ue(V,ie)-ue(C(V),ie)}function me(V){return Hs(V)-Hs(C(V))}function C(V){return M===V&&K||M}function ue(V,ie){return(Pe(V)?V.changedTouches[0]:V)["page"+x(ie?"Y":"X")]}function te(V){return V/(N&&e.is(Io)?Cg:1)}function fe(V){var ie=n.noDrag;return!ur(V,"."+Bu+", ."+Oa)&&(!ie||!ur(V,ie))}function Pe(V){return typeof TouchEvent<"u"&&V instanceof TouchEvent}function de(){return j}function we(V){T=V}return{mount:Y,disable:we,isDragging:de}}var Xg={Spacebar:" ",Right:_a,Left:Na,Up:Nu,Down:_u};function Ml(e){return e=Pi(e)?e:e.key,Xg[e]||e}var hc="keydown";function Ug(e,t,n){var i=an(e),o=i.on,r=i.bind,l=i.unbind,c=e.root,d=t.Direction.resolve,u,p;function y(){S(),o(hn,m),o(hn,S),o(di,x)}function S(){var F=n.keyboard;F&&(u=F==="global"?window:c,r(u,hc,w))}function m(){l(u,hc)}function h(F){p=F}function x(){var F=p;p=!0,pu(function(){p=F})}function w(F){if(!p){var v=Ml(F);v===d(Na)?e.go("<"):v===d(_a)&&e.go(">")}}return{mount:y,destroy:m,disable:h}}var sr=yl+"-lazy",ua=sr+"-srcset",qg="["+sr+"], ["+ua+"]";function Kg(e,t,n){var i=an(e),o=i.on,r=i.off,l=i.bind,c=i.emit,d=n.lazyLoad==="sequential",u=[Oo,Ji],p=[];function y(){n.lazyLoad&&(S(),o(ln,S))}function S(){ci(p),m(),d?F():(r(u),o(u,h),h())}function m(){t.Slides.forEach(function(v){fl(v.slide,qg).forEach(function(P){var M=Hn(P,sr),K=Hn(P,ua);if(M!==P.src||K!==P.srcset){var X=n.classes.spinner,j=P.parentElement,N=Pr(j,"."+X)||xo("span",X,j);p.push([P,v,N]),P.src||gr(P,"none")}})})}function h(){p=p.filter(function(v){var P=n.perPage*((n.preloadPages||1)+1)-1;return v[1].isWithin(e.index,P)?x(v):!0}),p.length||r(u)}function x(v){var P=v[0];Gn(v[1].slide,Bs),l(P,"load error",tn(w,v)),Vt(P,"src",Hn(P,sr)),Vt(P,"srcset",Hn(P,ua)),Xn(P,sr),Xn(P,ua)}function w(v,P){var M=v[0],K=v[1];ri(K.slide,Bs),P.type!=="error"&&(Yi(v[2]),gr(M,""),c(Cl,M,K),c(To)),d&&F()}function F(){p.length&&x(p.shift())}return{mount:y,destroy:tn(ci,p),check:h}}function Yg(e,t,n){var i=an(e),o=i.on,r=i.emit,l=i.bind,c=t.Slides,d=t.Elements,u=t.Controller,p=u.hasFocus,y=u.getIndex,S=u.go,m=t.Direction.resolve,h=d.pagination,x=[],w,F;function v(){P(),o([hn,ln,ba],v);var T=n.pagination;h&&gr(h,T?"":"none"),T&&(o([di,ka,Ji],_),M(),_(),r(Eu,{list:w,items:x},N(e.index)))}function P(){w&&(Yi(h?Ai(w.children):w),ri(w,F),ci(x),w=null),i.destroy()}function M(){var T=e.length,L=n.classes,Y=n.i18n,R=n.perPage,I=p()?u.getEnd()+1:hr(T/R);w=h||xo("ul",L.pagination,d.track.parentElement),Gn(w,F=Da+"--"+j()),Vt(w,ai,"tablist"),Vt(w,En,Y.select),Vt(w,Il,j()===Ha?"vertical":"");for(var $=0;$<I;$++){var G=xo("li",null,w),O=xo("button",{class:L.page,type:"button"},G),U=c.getIn($).map(function(f){return f.slide.id}),E=!p()&&R>1?Y.pageX:Y.slideX;l(O,"click",tn(K,$)),n.paginationKeyboard&&l(O,"keydown",tn(X,$)),Vt(G,ai,"presentation"),Vt(O,ai,"tab"),Vt(O,Er,U.join(" ")),Vt(O,En,Os(E,$+1)),Vt(O,bo,-1),x.push({li:G,button:O,page:$})}}function K(T){S(">"+T,!0)}function X(T,L){var Y=x.length,R=Ml(L),I=j(),$=-1;R===m(_a,!1,I)?$=++T%Y:R===m(Na,!1,I)?$=(--T+Y)%Y:R==="Home"?$=0:R==="End"&&($=Y-1);var G=x[$];G&&(fu(G.button),S(">"+$),ni(L,!0))}function j(){return n.paginationDirection||n.direction}function N(T){return x[u.toPage(T)]}function _(){var T=N(y(!0)),L=N(y());if(T){var Y=T.button;ri(Y,Qi),Xn(Y,cc),Vt(Y,bo,-1)}if(L){var R=L.button;Gn(R,Qi),Vt(R,cc,!0),Vt(R,bo,"")}r(Ru,{list:w,items:x},T,L)}return{items:x,mount:v,destroy:P,getAt:N,update:_}}var Qg=[" ","Enter"];function Zg(e,t,n){var i=n.isNavigation,o=n.slideFocus,r=[];function l(){e.splides.forEach(function(h){h.isParent||(u(e,h.splide),u(h.splide,e))}),i&&p()}function c(){r.forEach(function(h){h.destroy()}),ci(r)}function d(){c(),l()}function u(h,x){var w=an(h);w.on(di,function(F,v,P){x.go(x.is(Do)?P:F)}),r.push(w)}function p(){var h=an(e),x=h.on;x(xl,S),x(Au,m),x([Fi,hn],y),r.push(h),h.emit(Sl,e.splides)}function y(){Vt(t.Elements.list,Il,n.direction===Ha?"vertical":"")}function S(h){e.go(h.index)}function m(h,x){gl(Qg,Ml(x))&&(S(h),ni(x))}return{setup:tn(t.Media.set,{slideFocus:Tr(o)?i:o},!0),mount:l,destroy:c,remount:d}}function Jg(e,t,n){var i=an(e),o=i.bind,r=0;function l(){n.wheel&&o(t.Elements.track,"wheel",c,uo)}function c(u){if(u.cancelable){var p=u.deltaY,y=p<0,S=Hs(u),m=n.wheelMinThreshold||0,h=n.wheelSleep||0;xn(p)>m&&S-r>h&&(e.go(y?"<":">"),r=S),d(y)&&ni(u)}}function d(u){return!n.releaseWheel||e.state.is(Wo)||t.Controller.getAdjacent(u)!==-1}return{mount:l}}var eh=90;function th(e,t,n){var i=an(e),o=i.on,r=t.Elements.track,l=n.live&&!n.isNavigation,c=xo("span",xg),d=Aa(eh,tn(p,!1));function u(){l&&(S(!t.Autoplay.isPaused()),Vt(r,pc,!0),c.textContent="…",o(wl,tn(S,!0)),o($l,tn(S,!1)),o([Oo,Ji],tn(p,!0)))}function p(m){Vt(r,uc,m),m?(Lr(r,c),d.start()):(Yi(c),d.cancel())}function y(){Xn(r,[dc,pc,uc]),Yi(c)}function S(m){l&&Vt(r,dc,m?"off":"polite")}return{mount:u,disable:S,destroy:y}}var nh=Object.freeze({__proto__:null,Media:dg,Direction:ug,Elements:Tg,Slides:Lg,Layout:Pg,Clones:Eg,Move:Rg,Controller:kg,Arrows:Ng,Autoplay:Hg,Cover:Wg,Scroll:Vg,Drag:Gg,Keyboard:Ug,LazyLoad:Kg,Pagination:Yg,Sync:Zg,Wheel:Jg,Live:th}),ih={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"},oh={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:wg,i18n:ih,reducedMotion:{speed:0,rewindSpeed:0,autoplay:"pause"}};function rh(e,t,n){var i=t.Slides;function o(){an(e).on([Fi,ln],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),pu(d)}return{mount:o,start:l,cancel:_s}}function ah(e,t,n){var i=t.Move,o=t.Controller,r=t.Scroll,l=t.Elements.list,c=tn(_n,l,"transition"),d;function u(){an(e).bind(l,"transitionend",function(m){m.target===l&&d&&(y(),d())})}function p(m,h){var x=i.toPosition(m,!0),w=i.getPosition(),F=S(m);xn(x-w)>=1&&F>=1?n.useScroll?r.scroll(x,F,!1,h):(c("transform "+F+"ms "+n.easing),i.translate(x,!0),d=h):(i.jump(m),h())}function y(){c(""),r.cancel()}function S(m){var h=n.rewindSpeed;if(e.is(Io)&&h){var x=o.getIndex(!0),w=o.getEnd();if(x===0&&m>=w||x>=w&&m===0)return h}return n.speed}return{mount:u,start:p,cancel:y}}var sh=(function(){function e(n,i){this.event=an(),this.Components={},this.state=lg(go),this.splides=[],this._o={},this._E={};var o=Pi(n)?vu(document,n):n;ar(o,o+" is invalid."),this.root=o,i=Ci({label:Hn(o,En)||"",labelledby:Hn(o,Tl)||""},oh,e.defaults,i||{});try{Ci(i,JSON.parse(Hn(o,yl)))}catch{ar(!1,"Invalid JSON")}this._o=Object.create(Ci({},i))}var t=e.prototype;return t.mount=function(i,o){var r=this,l=this.state,c=this.Components;ar(l.is([go,ya]),"Already mounted!"),l.set(go),this._C=c,this._T=o||this._T||(this.is(Rr)?rh:ah),this._E=i||this._E;var d=mr({},nh,this._E,{Transition:this._T});return qi(d,function(u,p){var y=u(r,c,r._o);c[p]=y,y.setup&&y.setup()}),qi(c,function(u){u.mount&&u.mount()}),this.emit(Fi),Gn(this.root,bg),l.set(Co),this.emit(Ds),this},t.sync=function(i){return this.splides.push({splide:i}),i.splides.push({splide:this,isParent:!0}),this.state.is(Co)&&(this._C.Sync.remount(),i.Components.Sync.remount()),this},t.go=function(i){return this._C.Controller.go(i),this},t.on=function(i,o){return this.event.on(i,o),this},t.off=function(i){return this.event.off(i),this},t.emit=function(i){var o;return(o=this.event).emit.apply(o,[i].concat(Ai(arguments,1))),this},t.add=function(i,o){return this._C.Slides.add(i,o),this},t.remove=function(i){return this._C.Slides.remove(i),this},t.is=function(i){return this._o.type===i},t.refresh=function(){return this.emit(ln),this},t.destroy=function(i){i===void 0&&(i=!0);var o=this.event,r=this.state;return r.is(go)?an(this).on(Ds,this.destroy.bind(this,i)):(qi(this._C,function(l){l.destroy&&l.destroy(i)},!0),o.emit(bl),o.destroy(),i&&ci(this.splides),r.set(ya)),this},ig(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})(),El=sh;El.defaults={};El.STATES=rg;var fc=[[Fi,"onMounted"],[Ds,"onReady"],[di,"onMove"],[Oo,"onMoved"],[xl,"onClick"],[Su,"onActive"],[wu,"onInactive"],[$u,"onVisible"],[Cu,"onHidden"],[ln,"onRefresh"],[hn,"onUpdated"],[To,"onResize"],[Ra,"onResized"],[Tu,"onDrag"],[Iu,"onDragging"],[Lu,"onDragged"],[ka,"onScroll"],[Ji,"onScrolled"],[bl,"onDestroy"],[Pu,"onArrowsMounted"],[Mu,"onArrowsUpdated"],[Eu,"onPaginationMounted"],[Ru,"onPaginationUpdated"],[Sl,"onNavigationMounted"],[wl,"onAutoplayPlay"],[ku,"onAutoplayPlaying"],[$l,"onAutoplayPause"],[Cl,"onLazyLoadLoaded"]];function Rl(...e){return e.filter(Boolean).join(" ")}function Sa(e){return e!==null&&typeof e=="object"}function js(e,t){if(Array.isArray(e)&&Array.isArray(t))return e.length===t.length&&!e.some((n,i)=>!js(n,t[i]));if(Sa(e)&&Sa(t)){const n=Object.keys(e),i=Object.keys(t);return n.length===i.length&&!n.some(o=>!Object.prototype.hasOwnProperty.call(t,o)||!js(e[o],t[o]))}return e===t}function lh(e,t){return e.length===t.length&&!e.some((n,i)=>n!==t[i])}function ch(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 Vs(e,t){const n=e;return ch(t,(i,o)=>{Array.isArray(i)?n[o]=i.slice():Sa(i)?n[o]=Vs(Sa(n[o])?n[o]:{},i):n[o]=i}),n}var dh=({children:e,className:t,...n})=>s.createElement("div",{className:Rl("splide__track",t),...n},s.createElement("ul",{className:"splide__list"},e)),kl=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 El(i,e),this.bind(this.splide),this.splide.mount(t,n),this.options=Vs({},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&&!js(this.options,e)&&(this.splide.options=e,this.options=Vs({},e));const t=this.getSlides();lh(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){fc.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:Rl("splide",e),ref:this.splideRef,...this.omit(o,["options",...fc.map(r=>r[1])])},n?s.createElement(dh,null,i):i)}},Al=({children:e,className:t,...n})=>s.createElement("li",{className:Rl("splide__slide",t),...n},e);/*!
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const a=require("react/jsx-runtime"),s=require("react"),Et=require("classnames"),b=require("./EmbedMediaFrame-C__c1jQ6.js"),qn=require("react-dom");function pm(e){return e.type==="object"&&e.version===1}const mm="ControlSlider-module__wrapper___sHEkd",gm="ControlSlider-module__hoverArrow___A-dOH",hm="ControlSlider-module__sliderItem___QQSkR",fm="ControlSlider-module__sliderImage___9hRl-",ym="ControlSlider-module__arrow___05ghY",vm="ControlSlider-module__arrowVertical___tBfVN",xm="ControlSlider-module__nextArrow___-30Yc",bm="ControlSlider-module__arrowInner___aEra3",Sm="ControlSlider-module__arrowIcon___S4ztF",wm="ControlSlider-module__arrowImg___2dwJW",$m="ControlSlider-module__mirror___brd6U",Cm="ControlSlider-module__pagination___bicLF",Tm="ControlSlider-module__paginationInner___bT-P-",Im="ControlSlider-module__paginationVertical___zYqKw",Lm="ControlSlider-module__paginationItem___nTRbk",Pm="ControlSlider-module__dot___p1Qun",Mm="ControlSlider-module__activeDot___LHFaj",Em="ControlSlider-module__paginationInsideBottom___R3FWn",Rm="ControlSlider-module__paginationInsideTop___V-qb-",km="ControlSlider-module__paginationOutsideBottom___14w8D",Am="ControlSlider-module__paginationOutsideTop___SCLqB",Fm="ControlSlider-module__paginationInsideLeft___yOBRZ",Nm="ControlSlider-module__paginationInsideRight___Rtt3o",_m="ControlSlider-module__paginationOutsideLeft___lahaw",Hm="ControlSlider-module__paginationOutsideRight___EtuQa",Wm="ControlSlider-module__imgWrapper___UjEgB",Om="ControlSlider-module__captionBlock___dJ6-j",Dm="ControlSlider-module__captionTextWrapper___HFlpf",zm="ControlSlider-module__captionText___uGBVc",Bm="ControlSlider-module__active___WZK4G",jm="ControlSlider-module__withPointerEvents___t-18M",Vm="ControlSlider-module__topLeftAlignment___zjnGM",Gm="ControlSlider-module__topCenterAlignment___gD1xW",Xm="ControlSlider-module__topRightAlignment___NMapS",Um="ControlSlider-module__middleLeftAlignment___OnUrY",qm="ControlSlider-module__middleCenterAlignment___Tdkl0",Km="ControlSlider-module__middleRightAlignment___wEbfX",Ym="ControlSlider-module__bottomLeftAlignment___cTP2-",Qm="ControlSlider-module__bottomCenterAlignment___c54fB",Zm="ControlSlider-module__bottomRightAlignment___kEwrz",Jm="ControlSlider-module__clickOverlay___DZA28",eg="ControlSlider-module__contain___pLyq7",tg="ControlSlider-module__cover___KdDat",Mt={wrapper:mm,hoverArrow:gm,sliderItem:hm,sliderImage:fm,arrow:ym,arrowVertical:vm,nextArrow:xm,arrowInner:bm,arrowIcon:Sm,arrowImg:wm,mirror:$m,pagination:Cm,paginationInner:Tm,paginationVertical:Im,paginationItem:Lm,dot:Pm,activeDot:Mm,paginationInsideBottom:Em,paginationInsideTop:Rm,paginationOutsideBottom:km,paginationOutsideTop:Am,paginationInsideLeft:Fm,paginationInsideRight:Nm,paginationOutsideLeft:_m,paginationOutsideRight:Hm,imgWrapper:Wm,captionBlock:Om,captionTextWrapper:Dm,captionText:zm,active:Bm,withPointerEvents:jm,topLeftAlignment:Vm,topCenterAlignment:Gm,topRightAlignment:Xm,middleLeftAlignment:Um,middleCenterAlignment:qm,middleRightAlignment:Km,bottomLeftAlignment:Ym,bottomCenterAlignment:Qm,bottomRightAlignment:Zm,clickOverlay:Jm,contain:eg,cover:tg};function ng(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 ig(e,t,n){return t&&ng(e.prototype,t),Object.defineProperty(e,"prototype",{writable:!1}),e}var ic="(prefers-reduced-motion: reduce)",go=1,og=2,Co=3,Wo=4,Cr=5,la=6,ya=7,rg={CREATED:go,MOUNTED:og,IDLE:Co,MOVING:Wo,SCROLLING:Cr,DRAGGING:la,DESTROYED:ya};function ci(e){e.length=0}function Ai(e,t,n){return Array.prototype.slice.call(e,t,n)}function tn(e){return e.bind.apply(e,[null].concat(Ai(arguments,1)))}var pu=setTimeout,_s=function(){};function oc(e){return requestAnimationFrame(e)}function Ea(e,t){return typeof t===e}function dr(e){return!ml(e)&&Ea("object",e)}var pl=Array.isArray,mu=tn(Ea,"function"),Pi=tn(Ea,"string"),Tr=tn(Ea,"undefined");function ml(e){return e===null}function gu(e){try{return e instanceof(e.ownerDocument.defaultView||window).HTMLElement}catch{return!1}}function Ir(e){return pl(e)?e:[e]}function kn(e,t){Ir(e).forEach(t)}function gl(e,t){return e.indexOf(t)>-1}function ca(e,t){return e.push.apply(e,Ir(t)),e}function oi(e,t,n){e&&kn(t,function(i){i&&e.classList[n?"add":"remove"](i)})}function Gn(e,t){oi(e,Pi(t)?t.split(" "):t,!0)}function Lr(e,t){kn(t,e.appendChild.bind(e))}function hl(e,t){kn(e,function(n){var i=(t||n).parentNode;i&&i.insertBefore(n,t)})}function ur(e,t){return gu(e)&&(e.msMatchesSelector||e.matches).call(e,t)}function hu(e,t){var n=e?Ai(e.children):[];return t?n.filter(function(i){return ur(i,t)}):n}function Pr(e,t){return t?hu(e,t)[0]:e.firstElementChild}var pr=Object.keys;function qi(e,t,n){return e&&(n?pr(e).reverse():pr(e)).forEach(function(i){i!=="__proto__"&&t(e[i],i)}),e}function mr(e){return Ai(arguments,1).forEach(function(t){qi(t,function(n,i){e[i]=t[i]})}),e}function Ci(e){return Ai(arguments,1).forEach(function(t){qi(t,function(n,i){pl(n)?e[i]=n.slice():dr(n)?e[i]=Ci({},dr(e[i])?e[i]:{},n):e[i]=n})}),e}function rc(e,t){kn(t||pr(e),function(n){delete e[n]})}function Xn(e,t){kn(e,function(n){kn(t,function(i){n&&n.removeAttribute(i)})})}function jt(e,t,n){dr(t)?qi(t,function(i,o){jt(e,o,i)}):kn(e,function(i){ml(n)||n===""?Xn(i,t):i.setAttribute(t,String(n))})}function xo(e,t,n){var i=document.createElement(e);return t&&(Pi(t)?Gn(i,t):jt(i,t)),n&&Lr(n,i),i}function _n(e,t,n){if(Tr(n))return getComputedStyle(e)[t];ml(n)||(e.style[t]=""+n)}function gr(e,t){_n(e,"display",t)}function fu(e){e.setActive&&e.setActive()||e.focus({preventScroll:!0})}function Hn(e,t){return e.getAttribute(t)}function ac(e,t){return e&&e.classList.contains(t)}function Pn(e){return e.getBoundingClientRect()}function Yi(e){kn(e,function(t){t&&t.parentNode&&t.parentNode.removeChild(t)})}function yu(e){return Pr(new DOMParser().parseFromString(e,"text/html").body)}function ni(e,t){e.preventDefault(),t&&(e.stopPropagation(),e.stopImmediatePropagation())}function vu(e,t){return e&&e.querySelector(t)}function fl(e,t){return t?Ai(e.querySelectorAll(t)):[]}function ri(e,t){oi(e,t,!1)}function Hs(e){return e.timeStamp}function _i(e){return Pi(e)?e:e?e+"px":""}var Mr="splide",yl="data-"+Mr;function ar(e,t){if(!e)throw new Error("["+Mr+"] "+(t||""))}var Mi=Math.min,va=Math.max,xa=Math.floor,hr=Math.ceil,xn=Math.abs;function xu(e,t,n){return xn(e-t)<n}function da(e,t,n,i){var o=Mi(t,n),r=va(t,n);return i?o<e&&e<r:o<=e&&e<=r}function co(e,t,n){var i=Mi(t,n),o=va(t,n);return Mi(va(i,e),o)}function Ws(e){return+(e>0)-+(e<0)}function Os(e,t){return kn(t,function(n){e=e.replace("%s",""+n)}),e}function vl(e){return e<10?"0"+e:""+e}var sc={};function ag(e){return""+e+vl(sc[e]=(sc[e]||0)+1)}function bu(){var e=[];function t(l,c,d,u){o(l,c,function(p,y,S){var m="addEventListener"in p,h=m?p.removeEventListener.bind(p,y,d,u):p.removeListener.bind(p,d);m?p.addEventListener(y,d,u):p.addListener(d),e.push([p,y,S,d,h])})}function n(l,c,d){o(l,c,function(u,p,y){e=e.filter(function(S){return S[0]===u&&S[1]===p&&S[2]===y&&(!d||S[3]===d)?(S[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){kn(l,function(u){u&&kn(c,function(p){p.split(" ").forEach(function(y){var S=y.split(".");d(u,S[0],S[1])})})})}function r(){e.forEach(function(l){l[4]()}),ci(e)}return{bind:t,unbind:n,dispatch:i,destroy:r}}var Fi="mounted",Ds="ready",di="move",Oo="moved",xl="click",Su="active",wu="inactive",$u="visible",Cu="hidden",ln="refresh",hn="updated",To="resize",Ra="resized",Tu="drag",Iu="dragging",Lu="dragged",ka="scroll",Ji="scrolled",sg="overflow",bl="destroy",Pu="arrows:mounted",Mu="arrows:updated",Eu="pagination:mounted",Ru="pagination:updated",Sl="navigation:mounted",wl="autoplay:play",ku="autoplay:playing",$l="autoplay:pause",Cl="lazyload:loaded",Au="sk",Fu="sh",ba="ei";function an(e){var t=e?e.event.bus:document.createDocumentFragment(),n=bu();function i(r,l){n.bind(t,Ir(r).join(" "),function(c){l.apply(l,pl(c.detail)?c.detail:[])})}function o(r){n.dispatch(t,r,Ai(arguments,1))}return e&&e.event.on(bl,n.destroy),mr(n,{bus:t,on:i,off:tn(n.unbind,t),emit:o})}function Aa(e,t,n,i){var o=Date.now,r,l=0,c,d=!0,u=0;function p(){if(!d){if(l=e?Mi((o()-r)/e,1):1,n&&n(l),l>=1&&(t(),r=o(),i&&++u>=i))return S();c=oc(p)}}function y(F){F||h(),r=o()-(F?l*e:0),d=!1,c=oc(p)}function S(){d=!0}function m(){r=o(),l=0,n&&n(l)}function h(){c&&cancelAnimationFrame(c),l=0,c=0,d=!0}function x(F){e=F}function w(){return d}return{start:y,rewind:m,pause:S,cancel:h,set:x,isPaused:w}}function lg(e){var t=e;function n(o){t=o}function i(o){return gl(Ir(o),t)}return{set:n,is:i}}function cg(e,t){var n=Aa(0,e,null,1);return function(){n.isPaused()&&n.start()}}function dg(e,t,n){var i=e.state,o=n.breakpoints||{},r=n.reducedMotion||{},l=bu(),c=[];function d(){var h=n.mediaQuery==="min";pr(o).sort(function(x,w){return h?+x-+w:+w-+x}).forEach(function(x){p(o[x],"("+(h?"min":"max")+"-width:"+x+"px)")}),p(r,ic),y()}function u(h){h&&l.destroy()}function p(h,x){var w=matchMedia(x);l.bind(w,"change",y),c.push([h,w])}function y(){var h=i.is(ya),x=n.direction,w=c.reduce(function(F,v){return Ci(F,v[1].matches?v[0]:{})},{});rc(n),m(w),n.destroy?e.destroy(n.destroy==="completely"):h?(u(!0),e.mount()):x!==n.direction&&e.refresh()}function S(h){matchMedia(ic).matches&&(h?Ci(n,r):rc(n,pr(r)))}function m(h,x,w){Ci(n,h),x&&Ci(Object.getPrototypeOf(n),h),(w||!i.is(go))&&e.emit(hn,n)}return{setup:d,destroy:u,reduce:S,set:m}}var Fa="Arrow",Na=Fa+"Left",_a=Fa+"Right",Nu=Fa+"Up",_u=Fa+"Down",lc="rtl",Ha="ttb",Ka={width:["height"],left:["top","right"],right:["bottom","left"],x:["y"],X:["Y"],Y:["X"],ArrowLeft:[Nu,_a],ArrowRight:[_u,Na]};function ug(e,t,n){function i(r,l,c){c=c||n.direction;var d=c===lc&&!l?1:c===Ha?0:-1;return Ka[r]&&Ka[r][d]||r.replace(/width|left|right/i,function(u,p){var y=Ka[u.toLowerCase()][d]||u;return p>0?y.charAt(0).toUpperCase()+y.slice(1):y})}function o(r){return r*(n.direction===lc?1:-1)}return{resolve:i,orient:o}}var ai="role",bo="tabindex",pg="disabled",Wn="aria-",Er=Wn+"controls",Hu=Wn+"current",cc=Wn+"selected",En=Wn+"label",Tl=Wn+"labelledby",Wu=Wn+"hidden",Il=Wn+"orientation",fr=Wn+"roledescription",dc=Wn+"live",uc=Wn+"busy",pc=Wn+"atomic",Ll=[ai,bo,pg,Er,Hu,En,Tl,Wu,Il,fr],Kn=Mr+"__",Ni="is-",Ya=Mr,mc=Kn+"track",mg=Kn+"list",Wa=Kn+"slide",Ou=Wa+"--clone",gg=Wa+"__container",Pl=Kn+"arrows",Oa=Kn+"arrow",Du=Oa+"--prev",zu=Oa+"--next",Da=Kn+"pagination",Bu=Da+"__page",hg=Kn+"progress",fg=hg+"__bar",yg=Kn+"toggle",vg=Kn+"spinner",xg=Kn+"sr",bg=Ni+"initialized",Qi=Ni+"active",ju=Ni+"prev",Vu=Ni+"next",zs=Ni+"visible",Bs=Ni+"loading",Gu=Ni+"focus-in",Xu=Ni+"overflow",Sg=[Qi,zs,ju,Vu,Bs,Gu,Xu],wg={slide:Wa,clone:Ou,arrows:Pl,arrow:Oa,prev:Du,next:zu,pagination:Da,page:Bu,spinner:vg};function $g(e,t){if(mu(e.closest))return e.closest(t);for(var n=e;n&&n.nodeType===1&&!ur(n,t);)n=n.parentElement;return n}var Cg=5,gc=200,Uu="touchstart mousedown",Qa="touchmove mousemove",Za="touchend touchcancel mouseup click";function Tg(e,t,n){var i=an(e),o=i.on,r=i.bind,l=e.root,c=n.i18n,d={},u=[],p=[],y=[],S,m,h;function x(){P(),M(),v()}function w(){o(ln,F),o(ln,x),o(hn,v),r(document,Uu+" keydown",function(j){h=j.type==="keydown"},{capture:!0}),r(l,"focusin",function(){oi(l,Gu,!!h)})}function F(j){var N=Ll.concat("style");ci(u),ri(l,p),ri(S,y),Xn([S,m],N),Xn(l,j?N:["style",fr])}function v(){ri(l,p),ri(S,y),p=X(Ya),y=X(mc),Gn(l,p),Gn(S,y),jt(l,En,n.label),jt(l,Tl,n.labelledby)}function P(){S=K("."+mc),m=Pr(S,"."+mg),ar(S&&m,"A track/list element is missing."),ca(u,hu(m,"."+Wa+":not(."+Ou+")")),qi({arrows:Pl,pagination:Da,prev:Du,next:zu,bar:fg,toggle:yg},function(j,N){d[N]=K("."+j)}),mr(d,{root:l,track:S,list:m,slides:u})}function M(){var j=l.id||ag(Mr),N=n.role;l.id=j,S.id=S.id||j+"-track",m.id=m.id||j+"-list",!Hn(l,ai)&&l.tagName!=="SECTION"&&N&&jt(l,ai,N),jt(l,fr,c.carousel),jt(m,ai,"presentation")}function K(j){var N=vu(l,j);return N&&$g(N,"."+Ya)===l?N:void 0}function X(j){return[j+"--"+n.type,j+"--"+n.direction,n.drag&&j+"--draggable",n.isNavigation&&j+"--nav",j===Ya&&Qi]}return mr(d,{setup:x,mount:w,destroy:F})}var Io="slide",Do="loop",Rr="fade";function Ig(e,t,n,i){var o=an(e),r=o.on,l=o.emit,c=o.bind,d=e.Components,u=e.root,p=e.options,y=p.isNavigation,S=p.updateOnMove,m=p.i18n,h=p.pagination,x=p.slideFocus,w=d.Direction.resolve,F=Hn(i,"style"),v=Hn(i,En),P=n>-1,M=Pr(i,"."+gg),K;function X(){P||(i.id=u.id+"-slide"+vl(t+1),jt(i,ai,h?"tabpanel":"group"),jt(i,fr,m.slide),jt(i,En,v||Os(m.slideLabel,[t+1,e.length]))),j()}function j(){c(i,"click",tn(l,xl,U)),c(i,"keydown",tn(l,Au,U)),r([Oo,Fu,Ji],L),r(Sl,_),S&&r(di,T)}function N(){K=!0,o.destroy(),ri(i,Sg),Xn(i,Ll),jt(i,"style",F),jt(i,En,v||"")}function _(){var E=e.splides.map(function(f){var Q=f.splide.Components.Slides.getAt(t);return Q?Q.slide.id:""}).join(" ");jt(i,En,Os(m.slideX,(P?n:t)+1)),jt(i,Er,E),jt(i,ai,x?"button":""),x&&Xn(i,fr)}function T(){K||L()}function L(){if(!K){var E=e.index;Y(),R(),oi(i,ju,t===E-1),oi(i,Vu,t===E+1)}}function Y(){var E=$();E!==ac(i,Qi)&&(oi(i,Qi,E),jt(i,Hu,y&&E||""),l(E?Su:wu,U))}function R(){var E=G(),f=!E&&(!$()||P);if(e.state.is([Wo,Cr])||jt(i,Wu,f||""),jt(fl(i,p.focusableNodes||""),bo,f?-1:""),x&&jt(i,bo,f?-1:0),E!==ac(i,zs)&&(oi(i,zs,E),l(E?$u:Cu,U)),!E&&document.activeElement===i){var Q=d.Slides.getAt(e.index);Q&&fu(Q.slide)}}function I(E,f,Q){_n(Q&&M||i,E,f)}function $(){var E=e.index;return E===t||p.cloneStatus&&E===n}function G(){if(e.is(Rr))return $();var E=Pn(d.Elements.track),f=Pn(i),Q=w("left",!0),q=w("right",!0);return xa(E[Q])<=hr(f[Q])&&xa(f[q])<=hr(E[q])}function O(E,f){var Q=xn(E-t);return!P&&(p.rewind||e.is(Do))&&(Q=Mi(Q,e.length-Q)),Q<=f}var U={index:t,slideIndex:n,slide:i,container:M,isClone:P,mount:X,destroy:N,update:L,style:I,isWithin:O};return U}function Lg(e,t,n){var i=an(e),o=i.on,r=i.emit,l=i.bind,c=t.Elements,d=c.slides,u=c.list,p=[];function y(){S(),o(ln,m),o(ln,S)}function S(){d.forEach(function(L,Y){x(L,Y,-1)})}function m(){K(function(L){L.destroy()}),ci(p)}function h(){K(function(L){L.update()})}function x(L,Y,R){var I=Ig(e,Y,R,L);I.mount(),p.push(I),p.sort(function($,G){return $.index-G.index})}function w(L){return L?X(function(Y){return!Y.isClone}):p}function F(L){var Y=t.Controller,R=Y.toIndex(L),I=Y.hasFocus()?1:n.perPage;return X(function($){return da($.index,R,R+I-1)})}function v(L){return X(L)[0]}function P(L,Y){kn(L,function(R){if(Pi(R)&&(R=yu(R)),gu(R)){var I=d[Y];I?hl(R,I):Lr(u,R),Gn(R,n.classes.slide),N(R,tn(r,To))}}),r(ln)}function M(L){Yi(X(L).map(function(Y){return Y.slide})),r(ln)}function K(L,Y){w(Y).forEach(L)}function X(L){return p.filter(mu(L)?L:function(Y){return Pi(L)?ur(Y.slide,L):gl(Ir(L),Y.index)})}function j(L,Y,R){K(function(I){I.style(L,Y,R)})}function N(L,Y){var R=fl(L,"img"),I=R.length;I?R.forEach(function($){l($,"load error",function(){--I||Y()})}):Y()}function _(L){return L?d.length:p.length}function T(){return p.length>n.perPage}return{mount:y,destroy:m,update:h,register:x,get:w,getIn:F,getAt:v,add:P,remove:M,forEach:K,filter:X,style:j,getLength:_,isEnough:T}}function Pg(e,t,n){var i=an(e),o=i.on,r=i.bind,l=i.emit,c=t.Slides,d=t.Direction.resolve,u=t.Elements,p=u.root,y=u.track,S=u.list,m=c.getAt,h=c.style,x,w,F;function v(){P(),r(window,"resize load",cg(tn(l,To))),o([hn,ln],P),o(To,M)}function P(){x=n.direction===Ha,_n(p,"maxWidth",_i(n.width)),_n(y,d("paddingLeft"),K(!1)),_n(y,d("paddingRight"),K(!0)),M(!0)}function M(U){var E=Pn(p);(U||w.width!==E.width||w.height!==E.height)&&(_n(y,"height",X()),h(d("marginRight"),_i(n.gap)),h("width",N()),h("height",_(),!0),w=E,l(Ra),F!==(F=O())&&(oi(p,Xu,F),l(sg,F)))}function K(U){var E=n.padding,f=d(U?"right":"left");return E&&_i(E[f]||(dr(E)?0:E))||"0px"}function X(){var U="";return x&&(U=j(),ar(U,"height or heightRatio is missing."),U="calc("+U+" - "+K(!1)+" - "+K(!0)+")"),U}function j(){return _i(n.height||Pn(S).width*n.heightRatio)}function N(){return n.autoWidth?null:_i(n.fixedWidth)||(x?"":T())}function _(){return _i(n.fixedHeight)||(x?n.autoHeight?null:T():j())}function T(){var U=_i(n.gap);return"calc((100%"+(U&&" + "+U)+")/"+(n.perPage||1)+(U&&" - "+U)+")"}function L(){return Pn(S)[d("width")]}function Y(U,E){var f=m(U||0);return f?Pn(f.slide)[d("width")]+(E?0:$()):0}function R(U,E){var f=m(U);if(f){var Q=Pn(f.slide)[d("right")],q=Pn(S)[d("left")];return xn(Q-q)+(E?0:$())}return 0}function I(U){return R(e.length-1)-R(0)+Y(0,U)}function $(){var U=m(0);return U&&parseFloat(_n(U.slide,d("marginRight")))||0}function G(U){return parseFloat(_n(y,d("padding"+(U?"Right":"Left"))))||0}function O(){return e.is(Rr)||I(!0)>L()}return{mount:v,resize:M,listSize:L,slideSize:Y,sliderSize:I,totalSize:R,getPadding:G,isOverflow:O}}var Mg=2;function Eg(e,t,n){var i=an(e),o=i.on,r=t.Elements,l=t.Slides,c=t.Direction.resolve,d=[],u;function p(){o(ln,y),o([hn,To],m),(u=w())&&(h(u),t.Layout.resize(!0))}function y(){S(),p()}function S(){Yi(d),ci(d),i.destroy()}function m(){var F=w();u!==F&&(u<F||!F)&&i.emit(ln)}function h(F){var v=l.get().slice(),P=v.length;if(P){for(;v.length<F;)ca(v,v);ca(v.slice(-F),v.slice(0,F)).forEach(function(M,K){var X=K<F,j=x(M.slide,K);X?hl(j,v[0].slide):Lr(r.list,j),ca(d,j),l.register(j,K-F+(X?0:P),M.index)})}}function x(F,v){var P=F.cloneNode(!0);return Gn(P,n.classes.clone),P.id=e.root.id+"-clone"+vl(v+1),P}function w(){var F=n.clones;if(!e.is(Do))F=0;else if(Tr(F)){var v=n[c("fixedWidth")]&&t.Layout.slideSize(0),P=v&&hr(Pn(r.track)[c("width")]/v);F=P||n[c("autoWidth")]&&e.length||n.perPage*Mg}return F}return{mount:p,destroy:S}}function Rg(e,t,n){var i=an(e),o=i.on,r=i.emit,l=e.state.set,c=t.Layout,d=c.slideSize,u=c.getPadding,p=c.totalSize,y=c.listSize,S=c.sliderSize,m=t.Direction,h=m.resolve,x=m.orient,w=t.Elements,F=w.list,v=w.track,P;function M(){P=t.Transition,o([Fi,Ra,hn,ln],K)}function K(){t.Controller.isBusy()||(t.Scroll.cancel(),j(e.index),t.Slides.update())}function X(f,Q,q,pe){f!==Q&&U(f>q)&&(L(),N(T(I(),f>q),!0)),l(Wo),r(di,Q,q,f),P.start(Q,function(){l(Co),r(Oo,Q,q,f),pe&&pe()})}function j(f){N(R(f,!0))}function N(f,Q){if(!e.is(Rr)){var q=Q?f:_(f);_n(F,"transform","translate"+h("X")+"("+q+"px)"),f!==q&&r(Fu)}}function _(f){if(e.is(Do)){var Q=Y(f),q=Q>t.Controller.getEnd(),pe=Q<0;(pe||q)&&(f=T(f,q))}return f}function T(f,Q){var q=f-O(Q),pe=S();return f-=x(pe*(hr(xn(q)/pe)||1))*(Q?1:-1),f}function L(){N(I(),!0),P.cancel()}function Y(f){for(var Q=t.Slides.get(),q=0,pe=1/0,k=0;k<Q.length;k++){var me=Q[k].index,C=xn(R(me,!0)-f);if(C<=pe)pe=C,q=me;else break}return q}function R(f,Q){var q=x(p(f-1)-G(f));return Q?$(q):q}function I(){var f=h("left");return Pn(F)[f]-Pn(v)[f]+x(u(!1))}function $(f){return n.trimSpace&&e.is(Io)&&(f=co(f,0,x(S(!0)-y()))),f}function G(f){var Q=n.focus;return Q==="center"?(y()-d(f,!0))/2:+Q*d(f)||0}function O(f){return R(f?t.Controller.getEnd():0,!!n.trimSpace)}function U(f){var Q=x(T(I(),f));return f?Q>=0:Q<=F[h("scrollWidth")]-Pn(v)[h("width")]}function E(f,Q){Q=Tr(Q)?I():Q;var q=f!==!0&&x(Q)<x(O(!1)),pe=f!==!1&&x(Q)>x(O(!0));return q||pe}return{mount:M,move:X,jump:j,translate:N,shift:T,cancel:L,toIndex:Y,toPosition:R,getPosition:I,getLimit:O,exceededLimit:E,reposition:K}}function kg(e,t,n){var i=an(e),o=i.on,r=i.emit,l=t.Move,c=l.getPosition,d=l.getLimit,u=l.toPosition,p=t.Slides,y=p.isEnough,S=p.getLength,m=n.omitEnd,h=e.is(Do),x=e.is(Io),w=tn(I,!1),F=tn(I,!0),v=n.start||0,P,M=v,K,X,j;function N(){_(),o([hn,ln,ba],_),o(Ra,T)}function _(){K=S(!0),X=n.perMove,j=n.perPage,P=U();var C=co(v,0,m?P:K-1);C!==v&&(v=C,l.reposition())}function T(){P!==U()&&r(ba)}function L(C,ue,te){if(!me()){var fe=R(C),Pe=O(fe);Pe>-1&&(ue||Pe!==v)&&(q(Pe),l.move(fe,Pe,M,te))}}function Y(C,ue,te,fe){t.Scroll.scroll(C,ue,te,function(){var Pe=O(l.toIndex(c()));q(m?Mi(Pe,P):Pe),fe&&fe()})}function R(C){var ue=v;if(Pi(C)){var te=C.match(/([+\-<>])(\d+)?/)||[],fe=te[1],Pe=te[2];fe==="+"||fe==="-"?ue=$(v+ +(""+fe+(+Pe||1)),v):fe===">"?ue=Pe?E(+Pe):w(!0):fe==="<"&&(ue=F(!0))}else ue=h?C:co(C,0,P);return ue}function I(C,ue){var te=X||(k()?1:j),fe=$(v+te*(C?-1:1),v,!(X||k()));return fe===-1&&x&&!xu(c(),d(!C),1)?C?0:P:ue?fe:O(fe)}function $(C,ue,te){if(y()||k()){var fe=G(C);fe!==C&&(ue=C,C=fe,te=!1),C<0||C>P?!X&&(da(0,C,ue,!0)||da(P,ue,C,!0))?C=E(f(C)):h?C=te?C<0?-(K%j||j):K:C:n.rewind?C=C<0?P:0:C=-1:te&&C!==ue&&(C=E(f(ue)+(C<ue?-1:1)))}else C=-1;return C}function G(C){if(x&&n.trimSpace==="move"&&C!==v)for(var ue=c();ue===u(C,!0)&&da(C,0,e.length-1,!n.rewind);)C<v?--C:++C;return C}function O(C){return h?(C+K)%K||0:C}function U(){for(var C=K-(k()||h&&X?1:j);m&&C-- >0;)if(u(K-1,!0)!==u(C,!0)){C++;break}return co(C,0,K-1)}function E(C){return co(k()?C:j*C,0,P)}function f(C){return k()?Mi(C,P):xa((C>=P?K-1:C)/j)}function Q(C){var ue=l.toIndex(C);return x?co(ue,0,P):ue}function q(C){C!==v&&(M=v,v=C)}function pe(C){return C?M:v}function k(){return!Tr(n.focus)||n.isNavigation}function me(){return e.state.is([Wo,Cr])&&!!n.waitForTransition}return{mount:N,go:L,scroll:Y,getNext:w,getPrev:F,getAdjacent:I,getEnd:U,setIndex:q,getIndex:pe,toIndex:E,toPage:f,toDest:Q,hasFocus:k,isBusy:me}}var Ag="http://www.w3.org/2000/svg",Fg="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",Hr=40;function Ng(e,t,n){var i=an(e),o=i.on,r=i.bind,l=i.emit,c=n.classes,d=n.i18n,u=t.Elements,p=t.Controller,y=u.arrows,S=u.track,m=y,h=u.prev,x=u.next,w,F,v={};function P(){K(),o(hn,M)}function M(){X(),P()}function K(){var Y=n.arrows;Y&&!(h&&x)&&_(),h&&x&&(mr(v,{prev:h,next:x}),gr(m,Y?"":"none"),Gn(m,F=Pl+"--"+n.direction),Y&&(j(),L(),jt([h,x],Er,S.id),l(Pu,h,x)))}function X(){i.destroy(),ri(m,F),w?(Yi(y?[h,x]:m),h=x=null):Xn([h,x],Ll)}function j(){o([Fi,Oo,ln,Ji,ba],L),r(x,"click",tn(N,">")),r(h,"click",tn(N,"<"))}function N(Y){p.go(Y,!0)}function _(){m=y||xo("div",c.arrows),h=T(!0),x=T(!1),w=!0,Lr(m,[h,x]),!y&&hl(m,S)}function T(Y){var R='<button class="'+c.arrow+" "+(Y?c.prev:c.next)+'" type="button"><svg xmlns="'+Ag+'" viewBox="0 0 '+Hr+" "+Hr+'" width="'+Hr+'" height="'+Hr+'" focusable="false"><path d="'+(n.arrowPath||Fg)+'" />';return yu(R)}function L(){if(h&&x){var Y=e.index,R=p.getPrev(),I=p.getNext(),$=R>-1&&Y<R?d.last:d.prev,G=I>-1&&Y>I?d.first:d.next;h.disabled=R<0,x.disabled=I<0,jt(h,En,$),jt(x,En,G),l(Mu,h,x,R,I)}}return{arrows:v,mount:P,destroy:X,update:L}}var _g=yl+"-interval";function Hg(e,t,n){var i=an(e),o=i.on,r=i.bind,l=i.emit,c=Aa(n.interval,e.go.bind(e,">"),j),d=c.isPaused,u=t.Elements,p=t.Elements,y=p.root,S=p.toggle,m=n.autoplay,h,x,w=m==="pause";function F(){m&&(v(),S&&jt(S,Er,u.track.id),w||P(),X())}function v(){n.pauseOnHover&&r(y,"mouseenter mouseleave",function(_){h=_.type==="mouseenter",K()}),n.pauseOnFocus&&r(y,"focusin focusout",function(_){x=_.type==="focusin",K()}),S&&r(S,"click",function(){w?P():M(!0)}),o([di,ka,ln],c.rewind),o(di,N)}function P(){d()&&t.Slides.isEnough()&&(c.start(!n.resetProgress),x=h=w=!1,X(),l(wl))}function M(_){_===void 0&&(_=!0),w=!!_,X(),d()||(c.pause(),l($l))}function K(){w||(h||x?M(!1):P())}function X(){S&&(oi(S,Qi,!w),jt(S,En,n.i18n[w?"play":"pause"]))}function j(_){var T=u.bar;T&&_n(T,"width",_*100+"%"),l(ku,_)}function N(_){var T=t.Slides.getAt(_);c.set(T&&+Hn(T.slide,_g)||n.interval)}return{mount:F,destroy:c.cancel,play:P,pause:M,isPaused:d}}function Wg(e,t,n){var i=an(e),o=i.on;function r(){n.cover&&(o(Cl,tn(c,!0)),o([Fi,hn,ln],tn(l,!0)))}function l(d){t.Slides.forEach(function(u){var p=Pr(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),gr(u,d?"none":"")}return{mount:r,destroy:tn(l,!1)}}var Og=10,Dg=600,zg=.6,Bg=1.5,jg=800;function Vg(e,t,n){var i=an(e),o=i.on,r=i.emit,l=e.state.set,c=t.Move,d=c.getPosition,u=c.getLimit,p=c.exceededLimit,y=c.translate,S=e.is(Io),m,h,x=1;function w(){o(di,M),o([hn,ln],K)}function F(j,N,_,T,L){var Y=d();if(M(),_&&(!S||!p())){var R=t.Layout.sliderSize(),I=Ws(j)*R*xa(xn(j)/R)||0;j=c.toPosition(t.Controller.toDest(j%R))+I}var $=xu(Y,j,1);x=1,N=$?0:N||va(xn(j-Y)/Bg,jg),h=T,m=Aa(N,v,tn(P,Y,j,L),1),l(Cr),r(ka),m.start()}function v(){l(Co),h&&h(),r(Ji)}function P(j,N,_,T){var L=d(),Y=j+(N-j)*X(T),R=(Y-L)*x;y(L+R),S&&!_&&p()&&(x*=zg,xn(R)<Og&&F(u(p(!0)),Dg,!1,h,!0))}function M(){m&&m.cancel()}function K(){m&&!m.isPaused()&&(M(),v())}function X(j){var N=n.easingFunc;return N?N(j):1-Math.pow(1-j,4)}return{mount:w,destroy:M,scroll:F,cancel:K}}var uo={passive:!1,capture:!0};function Gg(e,t,n){var i=an(e),o=i.on,r=i.emit,l=i.bind,c=i.unbind,d=e.state,u=t.Move,p=t.Scroll,y=t.Controller,S=t.Elements.track,m=t.Media.reduce,h=t.Direction,x=h.resolve,w=h.orient,F=u.getPosition,v=u.exceededLimit,P,M,K,X,j,N=!1,_,T,L;function Y(){l(S,Qa,_s,uo),l(S,Za,_s,uo),l(S,Uu,I,uo),l(S,"click",O,{capture:!0}),l(S,"dragstart",ni),o([Fi,hn],R)}function R(){var V=n.drag;we(!V),X=V==="free"}function I(V){if(_=!1,!T){var ie=Pe(V);fe(V.target)&&(ie||!V.button)&&(y.isBusy()?ni(V,!0):(L=ie?S:window,j=d.is([Wo,Cr]),K=null,l(L,Qa,$,uo),l(L,Za,G,uo),u.cancel(),p.cancel(),U(V)))}}function $(V){if(d.is(la)||(d.set(la),r(Tu)),V.cancelable)if(j){u.translate(P+te(k(V)));var ie=me(V)>gc,oe=N!==(N=v());(ie||oe)&&U(V),_=!0,r(Iu),ni(V)}else Q(V)&&(j=f(V),ni(V))}function G(V){d.is(la)&&(d.set(Co),r(Lu)),j&&(E(V),ni(V)),c(L,Qa,$),c(L,Za,G),j=!1}function O(V){!T&&_&&ni(V,!0)}function U(V){K=M,M=V,P=F()}function E(V){var ie=q(V),oe=pe(ie),le=n.rewind&&n.rewindByDrag;m(!1),X?y.scroll(oe,0,n.snap):e.is(Rr)?y.go(w(Ws(ie))<0?le?"<":"-":le?">":"+"):e.is(Io)&&N&&le?y.go(v(!0)?">":"<"):y.go(y.toDest(oe),!0),m(!0)}function f(V){var ie=n.dragMinThreshold,oe=dr(ie),le=oe&&ie.mouse||0,ve=(oe?ie.touch:+ie)||10;return xn(k(V))>(Pe(V)?ve:le)}function Q(V){return xn(k(V))>xn(k(V,!0))}function q(V){if(e.is(Do)||!N){var ie=me(V);if(ie&&ie<gc)return k(V)/ie}return 0}function pe(V){return F()+Ws(V)*Mi(xn(V)*(n.flickPower||600),X?1/0:t.Layout.listSize()*(n.flickMaxPages||1))}function k(V,ie){return ue(V,ie)-ue(C(V),ie)}function me(V){return Hs(V)-Hs(C(V))}function C(V){return M===V&&K||M}function ue(V,ie){return(Pe(V)?V.changedTouches[0]:V)["page"+x(ie?"Y":"X")]}function te(V){return V/(N&&e.is(Io)?Cg:1)}function fe(V){var ie=n.noDrag;return!ur(V,"."+Bu+", ."+Oa)&&(!ie||!ur(V,ie))}function Pe(V){return typeof TouchEvent<"u"&&V instanceof TouchEvent}function de(){return j}function we(V){T=V}return{mount:Y,disable:we,isDragging:de}}var Xg={Spacebar:" ",Right:_a,Left:Na,Up:Nu,Down:_u};function Ml(e){return e=Pi(e)?e:e.key,Xg[e]||e}var hc="keydown";function Ug(e,t,n){var i=an(e),o=i.on,r=i.bind,l=i.unbind,c=e.root,d=t.Direction.resolve,u,p;function y(){S(),o(hn,m),o(hn,S),o(di,x)}function S(){var F=n.keyboard;F&&(u=F==="global"?window:c,r(u,hc,w))}function m(){l(u,hc)}function h(F){p=F}function x(){var F=p;p=!0,pu(function(){p=F})}function w(F){if(!p){var v=Ml(F);v===d(Na)?e.go("<"):v===d(_a)&&e.go(">")}}return{mount:y,destroy:m,disable:h}}var sr=yl+"-lazy",ua=sr+"-srcset",qg="["+sr+"], ["+ua+"]";function Kg(e,t,n){var i=an(e),o=i.on,r=i.off,l=i.bind,c=i.emit,d=n.lazyLoad==="sequential",u=[Oo,Ji],p=[];function y(){n.lazyLoad&&(S(),o(ln,S))}function S(){ci(p),m(),d?F():(r(u),o(u,h),h())}function m(){t.Slides.forEach(function(v){fl(v.slide,qg).forEach(function(P){var M=Hn(P,sr),K=Hn(P,ua);if(M!==P.src||K!==P.srcset){var X=n.classes.spinner,j=P.parentElement,N=Pr(j,"."+X)||xo("span",X,j);p.push([P,v,N]),P.src||gr(P,"none")}})})}function h(){p=p.filter(function(v){var P=n.perPage*((n.preloadPages||1)+1)-1;return v[1].isWithin(e.index,P)?x(v):!0}),p.length||r(u)}function x(v){var P=v[0];Gn(v[1].slide,Bs),l(P,"load error",tn(w,v)),jt(P,"src",Hn(P,sr)),jt(P,"srcset",Hn(P,ua)),Xn(P,sr),Xn(P,ua)}function w(v,P){var M=v[0],K=v[1];ri(K.slide,Bs),P.type!=="error"&&(Yi(v[2]),gr(M,""),c(Cl,M,K),c(To)),d&&F()}function F(){p.length&&x(p.shift())}return{mount:y,destroy:tn(ci,p),check:h}}function Yg(e,t,n){var i=an(e),o=i.on,r=i.emit,l=i.bind,c=t.Slides,d=t.Elements,u=t.Controller,p=u.hasFocus,y=u.getIndex,S=u.go,m=t.Direction.resolve,h=d.pagination,x=[],w,F;function v(){P(),o([hn,ln,ba],v);var T=n.pagination;h&&gr(h,T?"":"none"),T&&(o([di,ka,Ji],_),M(),_(),r(Eu,{list:w,items:x},N(e.index)))}function P(){w&&(Yi(h?Ai(w.children):w),ri(w,F),ci(x),w=null),i.destroy()}function M(){var T=e.length,L=n.classes,Y=n.i18n,R=n.perPage,I=p()?u.getEnd()+1:hr(T/R);w=h||xo("ul",L.pagination,d.track.parentElement),Gn(w,F=Da+"--"+j()),jt(w,ai,"tablist"),jt(w,En,Y.select),jt(w,Il,j()===Ha?"vertical":"");for(var $=0;$<I;$++){var G=xo("li",null,w),O=xo("button",{class:L.page,type:"button"},G),U=c.getIn($).map(function(f){return f.slide.id}),E=!p()&&R>1?Y.pageX:Y.slideX;l(O,"click",tn(K,$)),n.paginationKeyboard&&l(O,"keydown",tn(X,$)),jt(G,ai,"presentation"),jt(O,ai,"tab"),jt(O,Er,U.join(" ")),jt(O,En,Os(E,$+1)),jt(O,bo,-1),x.push({li:G,button:O,page:$})}}function K(T){S(">"+T,!0)}function X(T,L){var Y=x.length,R=Ml(L),I=j(),$=-1;R===m(_a,!1,I)?$=++T%Y:R===m(Na,!1,I)?$=(--T+Y)%Y:R==="Home"?$=0:R==="End"&&($=Y-1);var G=x[$];G&&(fu(G.button),S(">"+$),ni(L,!0))}function j(){return n.paginationDirection||n.direction}function N(T){return x[u.toPage(T)]}function _(){var T=N(y(!0)),L=N(y());if(T){var Y=T.button;ri(Y,Qi),Xn(Y,cc),jt(Y,bo,-1)}if(L){var R=L.button;Gn(R,Qi),jt(R,cc,!0),jt(R,bo,"")}r(Ru,{list:w,items:x},T,L)}return{items:x,mount:v,destroy:P,getAt:N,update:_}}var Qg=[" ","Enter"];function Zg(e,t,n){var i=n.isNavigation,o=n.slideFocus,r=[];function l(){e.splides.forEach(function(h){h.isParent||(u(e,h.splide),u(h.splide,e))}),i&&p()}function c(){r.forEach(function(h){h.destroy()}),ci(r)}function d(){c(),l()}function u(h,x){var w=an(h);w.on(di,function(F,v,P){x.go(x.is(Do)?P:F)}),r.push(w)}function p(){var h=an(e),x=h.on;x(xl,S),x(Au,m),x([Fi,hn],y),r.push(h),h.emit(Sl,e.splides)}function y(){jt(t.Elements.list,Il,n.direction===Ha?"vertical":"")}function S(h){e.go(h.index)}function m(h,x){gl(Qg,Ml(x))&&(S(h),ni(x))}return{setup:tn(t.Media.set,{slideFocus:Tr(o)?i:o},!0),mount:l,destroy:c,remount:d}}function Jg(e,t,n){var i=an(e),o=i.bind,r=0;function l(){n.wheel&&o(t.Elements.track,"wheel",c,uo)}function c(u){if(u.cancelable){var p=u.deltaY,y=p<0,S=Hs(u),m=n.wheelMinThreshold||0,h=n.wheelSleep||0;xn(p)>m&&S-r>h&&(e.go(y?"<":">"),r=S),d(y)&&ni(u)}}function d(u){return!n.releaseWheel||e.state.is(Wo)||t.Controller.getAdjacent(u)!==-1}return{mount:l}}var eh=90;function th(e,t,n){var i=an(e),o=i.on,r=t.Elements.track,l=n.live&&!n.isNavigation,c=xo("span",xg),d=Aa(eh,tn(p,!1));function u(){l&&(S(!t.Autoplay.isPaused()),jt(r,pc,!0),c.textContent="…",o(wl,tn(S,!0)),o($l,tn(S,!1)),o([Oo,Ji],tn(p,!0)))}function p(m){jt(r,uc,m),m?(Lr(r,c),d.start()):(Yi(c),d.cancel())}function y(){Xn(r,[dc,pc,uc]),Yi(c)}function S(m){l&&jt(r,dc,m?"off":"polite")}return{mount:u,disable:S,destroy:y}}var nh=Object.freeze({__proto__:null,Media:dg,Direction:ug,Elements:Tg,Slides:Lg,Layout:Pg,Clones:Eg,Move:Rg,Controller:kg,Arrows:Ng,Autoplay:Hg,Cover:Wg,Scroll:Vg,Drag:Gg,Keyboard:Ug,LazyLoad:Kg,Pagination:Yg,Sync:Zg,Wheel:Jg,Live:th}),ih={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"},oh={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:wg,i18n:ih,reducedMotion:{speed:0,rewindSpeed:0,autoplay:"pause"}};function rh(e,t,n){var i=t.Slides;function o(){an(e).on([Fi,ln],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),pu(d)}return{mount:o,start:l,cancel:_s}}function ah(e,t,n){var i=t.Move,o=t.Controller,r=t.Scroll,l=t.Elements.list,c=tn(_n,l,"transition"),d;function u(){an(e).bind(l,"transitionend",function(m){m.target===l&&d&&(y(),d())})}function p(m,h){var x=i.toPosition(m,!0),w=i.getPosition(),F=S(m);xn(x-w)>=1&&F>=1?n.useScroll?r.scroll(x,F,!1,h):(c("transform "+F+"ms "+n.easing),i.translate(x,!0),d=h):(i.jump(m),h())}function y(){c(""),r.cancel()}function S(m){var h=n.rewindSpeed;if(e.is(Io)&&h){var x=o.getIndex(!0),w=o.getEnd();if(x===0&&m>=w||x>=w&&m===0)return h}return n.speed}return{mount:u,start:p,cancel:y}}var sh=(function(){function e(n,i){this.event=an(),this.Components={},this.state=lg(go),this.splides=[],this._o={},this._E={};var o=Pi(n)?vu(document,n):n;ar(o,o+" is invalid."),this.root=o,i=Ci({label:Hn(o,En)||"",labelledby:Hn(o,Tl)||""},oh,e.defaults,i||{});try{Ci(i,JSON.parse(Hn(o,yl)))}catch{ar(!1,"Invalid JSON")}this._o=Object.create(Ci({},i))}var t=e.prototype;return t.mount=function(i,o){var r=this,l=this.state,c=this.Components;ar(l.is([go,ya]),"Already mounted!"),l.set(go),this._C=c,this._T=o||this._T||(this.is(Rr)?rh:ah),this._E=i||this._E;var d=mr({},nh,this._E,{Transition:this._T});return qi(d,function(u,p){var y=u(r,c,r._o);c[p]=y,y.setup&&y.setup()}),qi(c,function(u){u.mount&&u.mount()}),this.emit(Fi),Gn(this.root,bg),l.set(Co),this.emit(Ds),this},t.sync=function(i){return this.splides.push({splide:i}),i.splides.push({splide:this,isParent:!0}),this.state.is(Co)&&(this._C.Sync.remount(),i.Components.Sync.remount()),this},t.go=function(i){return this._C.Controller.go(i),this},t.on=function(i,o){return this.event.on(i,o),this},t.off=function(i){return this.event.off(i),this},t.emit=function(i){var o;return(o=this.event).emit.apply(o,[i].concat(Ai(arguments,1))),this},t.add=function(i,o){return this._C.Slides.add(i,o),this},t.remove=function(i){return this._C.Slides.remove(i),this},t.is=function(i){return this._o.type===i},t.refresh=function(){return this.emit(ln),this},t.destroy=function(i){i===void 0&&(i=!0);var o=this.event,r=this.state;return r.is(go)?an(this).on(Ds,this.destroy.bind(this,i)):(qi(this._C,function(l){l.destroy&&l.destroy(i)},!0),o.emit(bl),o.destroy(),i&&ci(this.splides),r.set(ya)),this},ig(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})(),El=sh;El.defaults={};El.STATES=rg;var fc=[[Fi,"onMounted"],[Ds,"onReady"],[di,"onMove"],[Oo,"onMoved"],[xl,"onClick"],[Su,"onActive"],[wu,"onInactive"],[$u,"onVisible"],[Cu,"onHidden"],[ln,"onRefresh"],[hn,"onUpdated"],[To,"onResize"],[Ra,"onResized"],[Tu,"onDrag"],[Iu,"onDragging"],[Lu,"onDragged"],[ka,"onScroll"],[Ji,"onScrolled"],[bl,"onDestroy"],[Pu,"onArrowsMounted"],[Mu,"onArrowsUpdated"],[Eu,"onPaginationMounted"],[Ru,"onPaginationUpdated"],[Sl,"onNavigationMounted"],[wl,"onAutoplayPlay"],[ku,"onAutoplayPlaying"],[$l,"onAutoplayPause"],[Cl,"onLazyLoadLoaded"]];function Rl(...e){return e.filter(Boolean).join(" ")}function Sa(e){return e!==null&&typeof e=="object"}function js(e,t){if(Array.isArray(e)&&Array.isArray(t))return e.length===t.length&&!e.some((n,i)=>!js(n,t[i]));if(Sa(e)&&Sa(t)){const n=Object.keys(e),i=Object.keys(t);return n.length===i.length&&!n.some(o=>!Object.prototype.hasOwnProperty.call(t,o)||!js(e[o],t[o]))}return e===t}function lh(e,t){return e.length===t.length&&!e.some((n,i)=>n!==t[i])}function ch(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 Vs(e,t){const n=e;return ch(t,(i,o)=>{Array.isArray(i)?n[o]=i.slice():Sa(i)?n[o]=Vs(Sa(n[o])?n[o]:{},i):n[o]=i}),n}var dh=({children:e,className:t,...n})=>s.createElement("div",{className:Rl("splide__track",t),...n},s.createElement("ul",{className:"splide__list"},e)),kl=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 El(i,e),this.bind(this.splide),this.splide.mount(t,n),this.options=Vs({},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&&!js(this.options,e)&&(this.splide.options=e,this.options=Vs({},e));const t=this.getSlides();lh(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){fc.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:Rl("splide",e),ref:this.splideRef,...this.omit(o,["options",...fc.map(r=>r[1])])},n?s.createElement(dh,null,i):i)}},Al=({children:e,className:t,...n})=>s.createElement("li",{className:Rl("splide__slide",t),...n},e);/*!
|
|
2
2
|
* Splide.js
|
|
3
3
|
* Version : 4.1.3
|
|
4
4
|
* License : MIT
|
|
@@ -2652,7 +2652,7 @@ ${o}
|
|
|
2652
2652
|
left: -9999px;
|
|
2653
2653
|
top: 0;
|
|
2654
2654
|
}
|
|
2655
|
-
`}const sy=30,is=3,ly=12,cy=96,$c=3,pa=.72,dy=100,uy=10,py=e=>e/dy,my=e=>Math.max(0,e)/uy,gy=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")},hy=(e,t)=>Array.from({length:t*e.length},(n,i)=>e[i%e.length]),oo={ctx:void 0},fy=()=>oo.ctx!==void 0?oo.ctx:typeof document>"u"?(oo.ctx=null,oo.ctx):(oo.ctx=document.createElement("canvas").getContext("2d"),oo.ctx),yy=(e,t,n,i)=>{e.style.transform=`translate3d(${t}px, ${n}px, 0) rotate(${i}deg)`},Cc=e=>{e.style.transform=""},vy=e=>{if(!e||e==="none")return 0;try{return new DOMMatrixReadOnly(e).m41}catch{return 0}},xy=(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)},ep=96,tp=(e,t,n)=>{if(t<=0||Math.abs(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 y=p*d,S=y+d;o[p+1]=S,r[p+1]=r[p]+(c(y)+c(S))*.5*d}),{wavelength:i,periodArc:r[n],x:o,s:r}},by=(e,t)=>{const n=tp(e,t,ep);return!n||n.wavelength<=0?1:n.periodArc/n.wavelength},Sy=(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=(m,h)=>{if(h-m<=1)return[m,h];const x=m+h>>1;return l[x]<=r?d(x,h):d(m,x)},[u,p]=d(0,l.length-1),y=l[p]-l[u],S=y>0?(r-l[u])/y:0;return n*(o*e.wavelength+c[u]+(c[p]-c[u])*S)},wy=(e,t,n,i,o=0)=>{const r=Math.max(0,n),l=e>0?2*Math.PI*r/e:0,c=h=>i+t*Math.sin(l*h),d=h=>t*l*Math.cos(l*h),u=-o,y=e+o-u,S=Math.max(4,Math.ceil(r*4*(y/Math.max(e,1)))),m=Array.from({length:S},(h,x)=>{const w=u+x/S*y,F=u+(x+1)/S*y,v=F-w,P=c(w),M=c(F),K=w+v/3,X=P+d(w)*v/3,j=F-v/3,N=M-d(F)*v/3;return`C${K.toFixed(2)} ${X.toFixed(2)} ${j.toFixed(2)} ${N.toFixed(2)} ${F.toFixed(2)} ${M.toFixed(2)}`});return[`M${u.toFixed(2)} ${c(u).toFixed(2)}`,...m].join(" ")},$y=({item:e,prefix:t,textCss:n,capHeightPx:i,opticalOffsetY:o,imageGapPx:r,isCurve:l})=>{var m;const c=o!==0?{...n,transform:`translateY(${o}px)`}:n,d=i>0?{height:`${i}px`}:{fontSize:n.fontSize,height:`${pa}em`},u=((m=e.image)==null?void 0:m.assetId)&&a.jsx("img",{src:e.image.assetId,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),y=l?a.jsx("span",{className:`${t}-text`,style:c,children:Array.from(e.text).map((h,x)=>a.jsx("span",{className:`${t}-glyph`,"data-marquee-wave-node":!0,children:a.jsx("span",{className:`${t}-glyph-inner`,children:h===" "?" ":h})},x))}):a.jsx("span",{className:`${t}-text`,style:c,children:e.text}),S=a.jsxs(a.Fragment,{children:[p,y]});return a.jsx("div",{className:`${t}-item`,"data-marquee-text-item":!0,style:{gap:r},children:a.jsx(b.LinkWrapper,{link:e.link,className:`${t}-item-link`,style:{gap:r},children:S})})},Cy=({settings:e,content:t,isEditor:n,isPreviewMode:i})=>{const{prefix:o}=b.useScopedStyles(),[r,l]=s.useState(0),c=r>0?Math.round(r):0,{speed:d,direction:u,pauseOnHover:p,gap:y,layoutType:S,curveAmplitude:m,curveFrequency:h,textFontFamily:x,textFontSettings:w,textFontSize:F,textLetterSpacing:v,textWordSpacing:P,textTextAppearance:M,textColor:K,backgroundColor:X,ribbonWidth:j}=e,N=j??F,_=S==="curve",T=py(m),L=my(h),Y=s.useMemo(()=>ay(o,c,_),[o,c,_]),R=s.useMemo(()=>nn({fontSettings:{fontFamily:x,fontWeight:w.fontWeight,fontStyle:w.fontStyle},letterSpacing:v,wordSpacing:P,fontSize:F,lineHeight:F,textAppearance:M,color:K},n),[x,w,v,P,F,M,K,n]),I=De=>b.scalingValue(De,n??!1),$=((t==null?void 0:t.length)??0)>0,G=n?!!i:!0,O=$&&(G||!!n),U=Math.max(0,d)*sy,E=G&&p==="on",[f,Q]=s.useState(!1),q=G?E&&f?"paused":"running":"paused",pe=q==="running"&&U>0&&c>0,k=c>0&&U>0?c/U*1e3:0,me=s.useRef(null),C=s.useRef(null),ue=s.useRef(null),te=s.useRef(null),fe=s.useRef(null),Pe=s.useRef(null),de=s.useRef(pe),we=s.useRef(null),V=s.useRef(null),ie=s.useRef(T),oe=s.useRef(L);de.current=pe,ie.current=T,oe.current=L;const[le,ve]=s.useState(0),[Fe,Ee]=s.useState(0),[Ce,Se]=s.useState(0),[g,Z]=s.useState(0),[J,re]=s.useState(0),he=s.useMemo(()=>(t??[]).map(De=>{var _e,He;return`${De.text}\0${((_e=De.image)==null?void 0:_e.assetId)??""}\0${((He=De.link)==null?void 0:He.value)??""}`}).join("\0"),[t]),[z,B]=s.useState(is),ne=s.useMemo(()=>{const De=t??[];return De.length===0||!(G||n)?De:hy(De,z)},[t,G,z,n]),ce=O?$c:1;s.useLayoutEffect(()=>{B(is),l(0)},[he]),s.useLayoutEffect(()=>{var Be;const De=Pe.current;if(!De)return;const _e=()=>{const Ie=getComputedStyle(De),mt=parseFloat(Ie.fontSize)||0;if(mt<=0)return;const ot=fy();if(!ot){ve(mt*pa),Ee(0);return}ot.font=`${Ie.fontStyle} ${Ie.fontWeight} ${mt}px ${Ie.fontFamily}`;const Ct=ot.measureText("H"),rt=Ct.actualBoundingBoxAscent>0?Ct.actualBoundingBoxAscent:mt*pa,St=Math.max(0,Ct.actualBoundingBoxDescent||0),nt=Ct.fontBoundingBoxAscent||0,Rt=Ct.fontBoundingBoxDescent||0;ve(Gt=>Math.abs(Gt-rt)>.5?rt:Gt);const ht=nt>0||Rt>0?(Rt-St-(nt-rt))/2:0;Ee(Gt=>Math.abs(Gt-ht)>.25?ht:Gt)};_e();const He=typeof document<"u"?document.fonts:void 0;(Be=He==null?void 0:He.ready)==null||Be.then(_e).catch(()=>{});const Ae=new ResizeObserver(_e);return Ae.observe(De),()=>Ae.disconnect()},[R.fontFamily,R.fontWeight,R.fontStyle,R.fontSize,R.lineHeight]),s.useLayoutEffect(()=>{if(!O)return;const De=me.current,_e=te.current;if(!De||!_e)return;const He={id:0},Ae=()=>{const ot=De.offsetWidth||De.getBoundingClientRect().width,Ct=_e.offsetWidth||_e.getBoundingClientRect().width;if($&&ot>0&&Ct>0){const rt=Ct/z;if(rt>0){let St=ot,nt=ly;if(_){const ht=ot*ie.current,Gt=oe.current,Zt=Gt>0?2*Math.PI*Gt/ot:0,$e=by(ht,Zt);St=Math.max(ot,$e*ot/($c-1)),nt=cy}const Rt=Math.min(nt,Math.max(is,Math.ceil(St/rt)+1));if(Rt!==z){B(Rt);return}}}Ct>0&&l(Ct)},Be=()=>{cancelAnimationFrame(He.id),He.id=requestAnimationFrame(Ae)};Be();const Ie=new ResizeObserver(Be);Ie.observe(De),Ie.observe(_e);const mt=()=>{document.hidden||Be()};return document.addEventListener("visibilitychange",mt),window.addEventListener("pageshow",mt),window.addEventListener("focus",mt),()=>{cancelAnimationFrame(He.id),Ie.disconnect(),document.removeEventListener("visibilitychange",mt),window.removeEventListener("pageshow",mt),window.removeEventListener("focus",mt)}},[O,he,z,$,le,_,T,L]),s.useLayoutEffect(()=>{const De=fe.current;if(!De)return;const _e={id:0},He=()=>{const Be=De.offsetHeight;Be>0&&re(Ie=>Math.abs(Ie-Be)>.5?Be:Ie)};_e.id=requestAnimationFrame(He);const Ae=new ResizeObserver(()=>{cancelAnimationFrame(_e.id),_e.id=requestAnimationFrame(He)});return Ae.observe(De),()=>{cancelAnimationFrame(_e.id),Ae.disconnect()}},[N,n]),s.useLayoutEffect(()=>{if(!_){Se(0),Z(0);return}const De=me.current,_e=te.current;if(!De||!_e)return;const He={id:0},Ae=()=>{const Ie=De.offsetWidth,mt=_e.offsetHeight;Ie>0&&Z(ot=>Math.abs(ot-Ie)>.5?Ie:ot),mt>0&&Se(ot=>Math.abs(ot-mt)>.5?mt:ot)};He.id=requestAnimationFrame(Ae);const Be=new ResizeObserver(()=>{cancelAnimationFrame(He.id),He.id=requestAnimationFrame(Ae)});return Be.observe(De),Be.observe(_e),()=>{cancelAnimationFrame(He.id),Be.disconnect()}},[_,he,le,F,O]),s.useLayoutEffect(()=>{if(!O||c<=0)return;const De=ue.current;De&&gy(De)},[O,c,u,U]),s.useLayoutEffect(()=>{if(!_||!$)return;const De=me.current;if(!De)return;const _e={raf:0,cancelled:!1,lut:null,lutKey:"",itemsCache:[],cacheDirty:!0},He=()=>{for(const rt of _e.itemsCache)for(const St of rt.glyphs)Cc(St.inner)},Ae=()=>{const rt=C.current??De;_e.itemsCache=Array.from(De.querySelectorAll("[data-marquee-text-item]"),St=>{const nt=[];return St.querySelectorAll("[data-marquee-wave-node]").forEach(Rt=>{const ht=Rt.firstElementChild;ht&&nt.push({inner:ht,layoutLocalX:xy(Rt,rt)})}),{item:St,glyphs:nt}}),_e.cacheDirty=!1},Be=()=>{_e.cacheDirty&&Ae();const St=(C.current??De).offsetWidth||1,nt=St*ie.current,Rt=oe.current,ht=2*Math.PI*Rt/St,Gt=`${St}|${nt}|${ht}`;if(Gt!==_e.lutKey&&(_e.lutKey=Gt,_e.lut=tp(nt,ht,ep)),Math.abs(nt)<=0||ht<=0){He();return}const Zt=ue.current,$e=Zt?vy(getComputedStyle(Zt).transform):0,Ge=De.getBoundingClientRect(),ft=Ge.left,Lt=Ge.right,wt=_e.lut&&_e.lut.wavelength>0?Math.max(0,(_e.lut.periodArc/_e.lut.wavelength-1)*St):0;for(const{item:vt,glyphs:Nt}of _e.itemsCache){const Wt=vt.getBoundingClientRect();if(Wt.right<ft||Wt.left>Lt+wt){for(const Dt of Nt)Cc(Dt.inner);continue}for(const Dt of Nt){const Me=Dt.layoutLocalX+$e,ct=_e.lut?Sy(_e.lut,Me):Me,dt=ht*ct,kt=nt*Math.sin(dt),Ke=nt*ht*Math.cos(dt),st=Math.atan(Ke)*(180/Math.PI);yy(Dt.inner,ct-Me,kt,st)}}},Ie=()=>{_e.cancelled||(_e.raf=0,Be(),de.current&&!document.hidden&&(_e.raf=requestAnimationFrame(Ie)))},mt=()=>{_e.cancelled||_e.raf||(_e.raf=requestAnimationFrame(Ie))},ot=()=>{_e.cacheDirty=!0,Be(),mt()};we.current=mt,V.current=ot,Be(),mt();const Ct=()=>{if(document.hidden){cancelAnimationFrame(_e.raf),_e.raf=0;return}cancelAnimationFrame(_e.raf),_e.raf=0,ot()};return document.addEventListener("visibilitychange",Ct),window.addEventListener("pageshow",Ct),window.addEventListener("focus",Ct),()=>{_e.cancelled=!0,we.current=null,V.current=null,cancelAnimationFrame(_e.raf),document.removeEventListener("visibilitychange",Ct),window.removeEventListener("pageshow",Ct),window.removeEventListener("focus",Ct),He()}},[_,$]),s.useLayoutEffect(()=>{var De;!_||!$||(De=V.current)==null||De.call(V)},[_,$,r,he,z,le,T,L,g]),s.useLayoutEffect(()=>{var De;(De=we.current)==null||De.call(we)},[pe,u]);const ee=De=>{E&&De.pointerType==="mouse"&&Q(!0)},H=()=>{E&&Q(!1)},be=_?Math.abs(T)*100:0,ae=I(N),W={minHeight:ae,..._?{paddingTop:`${be}%`,paddingBottom:`${be}%`}:{}},ke={height:ae,..._?{visibility:"hidden"}:{backgroundColor:X}},ze={gap:I(y),minHeight:ae},Xe=g*T,Ue=Math.abs(Xe),Qe=J>0?J:Ce,We=Math.max(Ce,Qe),it=Ue+We/2,ye=Math.max(Qe,1),Te=_&&g>0&&We>0?wy(g,Xe,L,it,ye):"",Ve=Ue*2+We,Ze=Te?a.jsx("svg",{className:`${o}-curve-bg`,viewBox:`0 0 ${g} ${Ve}`,preserveAspectRatio:"none","aria-hidden":!0,children:a.jsx("path",{d:Te,fill:"none",stroke:X,strokeWidth:Qe,strokeLinecap:"butt",strokeLinejoin:"round"})}):null,et=a.jsx("div",{ref:fe,className:`${o}-ribbon`,style:ke,"aria-hidden":!0}),at={...R,lineHeight:le>0?`${le}px`:`${pa}em`},tt=(De,_e,He)=>a.jsx($y,{item:De,prefix:o,textCss:at,capHeightPx:le,opticalOffsetY:Fe,imageGapPx:I(y),isCurve:_},`${_e}-${He}`),Ye=a.jsx("span",{ref:Pe,"aria-hidden":!0,className:`${o}-cap-ref`,style:R,children:"H"}),xt=`${Math.max(0,k)/1e3}s`,pt=O?a.jsx("div",{ref:ue,className:`${o}-marquee-track`,"data-direction":u,onPointerEnter:ee,onPointerLeave:H,style:{WebkitAnimationDuration:xt,animationDuration:xt,WebkitAnimationPlayState:q,animationPlayState:q},children:Array.from({length:ce},(De,_e)=>a.jsx("div",{ref:_e===0?te:void 0,className:`${o}-marquee-set`,style:{...ze,paddingRight:I(y)},"aria-hidden":_e>0,children:ne.map((He,Ae)=>tt(He,_e,Ae))},`set-${_e}`))}):a.jsx("div",{ref:te,className:Et(`${o}-marquee-set`,`${o}-marquee-static`),style:ze,children:t==null?void 0:t.map((De,_e)=>tt(De,0,_e))});return a.jsxs("div",{ref:me,className:`${o}-wrapper`,"aria-label":"Marquee text",children:[a.jsx("style",{dangerouslySetInnerHTML:{__html:Y}}),Ye,a.jsxs("div",{ref:C,className:`${o}-marquee-wrapper`,style:W,children:[et,Ze,pt]})]})},Ty=`import { useLayoutEffect, useMemo, useRef, useState, type CSSProperties, type PointerEvent as ReactPointerEvent } from 'react';
|
|
2655
|
+
`}const sy=30,is=3,ly=12,cy=96,$c=3,pa=.72,dy=100,uy=10,py=e=>e/dy,my=e=>Math.max(0,e)/uy,gy=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")},hy=(e,t)=>Array.from({length:t*e.length},(n,i)=>e[i%e.length]),oo={ctx:void 0},fy=()=>oo.ctx!==void 0?oo.ctx:typeof document>"u"?(oo.ctx=null,oo.ctx):(oo.ctx=document.createElement("canvas").getContext("2d"),oo.ctx),yy=(e,t,n,i)=>{e.style.transform=`translate3d(${t}px, ${n}px, 0) rotate(${i}deg)`},Cc=e=>{e.style.transform=""},vy=e=>{if(!e||e==="none")return 0;try{return new DOMMatrixReadOnly(e).m41}catch{return 0}},xy=(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)},ep=96,tp=(e,t,n)=>{if(t<=0||Math.abs(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 y=p*d,S=y+d;o[p+1]=S,r[p+1]=r[p]+(c(y)+c(S))*.5*d}),{wavelength:i,periodArc:r[n],x:o,s:r}},by=(e,t)=>{const n=tp(e,t,ep);return!n||n.wavelength<=0?1:n.periodArc/n.wavelength},Sy=(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=(m,h)=>{if(h-m<=1)return[m,h];const x=m+h>>1;return l[x]<=r?d(x,h):d(m,x)},[u,p]=d(0,l.length-1),y=l[p]-l[u],S=y>0?(r-l[u])/y:0;return n*(o*e.wavelength+c[u]+(c[p]-c[u])*S)},wy=(e,t,n,i,o=0)=>{const r=Math.max(0,n),l=e>0?2*Math.PI*r/e:0,c=h=>i+t*Math.sin(l*h),d=h=>t*l*Math.cos(l*h),u=-o,y=e+o-u,S=Math.max(4,Math.ceil(r*4*(y/Math.max(e,1)))),m=Array.from({length:S},(h,x)=>{const w=u+x/S*y,F=u+(x+1)/S*y,v=F-w,P=c(w),M=c(F),K=w+v/3,X=P+d(w)*v/3,j=F-v/3,N=M-d(F)*v/3;return`C${K.toFixed(2)} ${X.toFixed(2)} ${j.toFixed(2)} ${N.toFixed(2)} ${F.toFixed(2)} ${M.toFixed(2)}`});return[`M${u.toFixed(2)} ${c(u).toFixed(2)}`,...m].join(" ")},$y=({item:e,prefix:t,textCss:n,capHeightPx:i,opticalOffsetY:o,imageGapPx:r,isCurve:l})=>{var m;const c=o!==0?{...n,transform:`translateY(${o}px)`}:n,d=i>0?{height:`${i}px`}:{fontSize:n.fontSize,height:`${pa}em`},u=((m=e.image)==null?void 0:m.assetId)&&a.jsx("img",{src:e.image.assetId,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),y=l?a.jsx("span",{className:`${t}-text`,style:c,children:Array.from(e.text).map((h,x)=>a.jsx("span",{className:`${t}-glyph`,"data-marquee-wave-node":!0,children:a.jsx("span",{className:`${t}-glyph-inner`,children:h===" "?" ":h})},x))}):a.jsx("span",{className:`${t}-text`,style:c,children:e.text}),S=a.jsxs(a.Fragment,{children:[p,y]});return a.jsx("div",{className:`${t}-item`,"data-marquee-text-item":!0,style:{gap:r},children:a.jsx(b.LinkWrapper,{link:e.link,className:`${t}-item-link`,style:{gap:r},children:S})})},Cy=({settings:e,content:t,isEditor:n,isPreviewMode:i})=>{const{prefix:o}=b.useScopedStyles(),[r,l]=s.useState(0),c=r>0?Math.round(r):0,{speed:d,direction:u,pauseOnHover:p,gap:y,layoutType:S,curveAmplitude:m,curveFrequency:h,textFontFamily:x,textFontSettings:w,textFontSize:F,textLetterSpacing:v,textWordSpacing:P,textTextAppearance:M,textColor:K,backgroundColor:X,ribbonWidth:j}=e,N=j??F,_=S==="curve",T=py(m),L=my(h),Y=s.useMemo(()=>ay(o,c,_),[o,c,_]),R=s.useMemo(()=>nn({fontSettings:{fontFamily:x,fontWeight:w.fontWeight,fontStyle:w.fontStyle},letterSpacing:v,wordSpacing:P,fontSize:F,lineHeight:F,textAppearance:M,color:K},n),[x,w,v,P,F,M,K,n]),I=De=>b.scalingValue(De,n??!1),$=((t==null?void 0:t.length)??0)>0,G=n?!!i:!0,O=$&&(G||!!n),U=Math.max(0,d)*sy,E=G&&p==="on",[f,Q]=s.useState(!1),q=G?E&&f?"paused":"running":"paused",pe=q==="running"&&U>0&&c>0,k=c>0&&U>0?c/U*1e3:0,me=s.useRef(null),C=s.useRef(null),ue=s.useRef(null),te=s.useRef(null),fe=s.useRef(null),Pe=s.useRef(null),de=s.useRef(pe),we=s.useRef(null),V=s.useRef(null),ie=s.useRef(T),oe=s.useRef(L);de.current=pe,ie.current=T,oe.current=L;const[le,ve]=s.useState(0),[Fe,Ee]=s.useState(0),[Ce,Se]=s.useState(0),[g,Z]=s.useState(0),[J,re]=s.useState(0),he=s.useMemo(()=>(t??[]).map(De=>{var _e,He;return`${De.text}\0${((_e=De.image)==null?void 0:_e.assetId)??""}\0${((He=De.link)==null?void 0:He.value)??""}`}).join("\0"),[t]),[z,B]=s.useState(is),ne=s.useMemo(()=>{const De=t??[];return De.length===0||!(G||n)?De:hy(De,z)},[t,G,z,n]),ce=O?$c:1;s.useLayoutEffect(()=>{B(is),l(0)},[he]),s.useLayoutEffect(()=>{var Be;const De=Pe.current;if(!De)return;const _e=()=>{const Ie=getComputedStyle(De),mt=parseFloat(Ie.fontSize)||0;if(mt<=0)return;const ot=fy();if(!ot){ve(mt*pa),Ee(0);return}ot.font=`${Ie.fontStyle} ${Ie.fontWeight} ${mt}px ${Ie.fontFamily}`;const Ct=ot.measureText("H"),rt=Ct.actualBoundingBoxAscent>0?Ct.actualBoundingBoxAscent:mt*pa,St=Math.max(0,Ct.actualBoundingBoxDescent||0),nt=Ct.fontBoundingBoxAscent||0,Rt=Ct.fontBoundingBoxDescent||0;ve(Vt=>Math.abs(Vt-rt)>.5?rt:Vt);const ht=nt>0||Rt>0?(Rt-St-(nt-rt))/2:0;Ee(Vt=>Math.abs(Vt-ht)>.25?ht:Vt)};_e();const He=typeof document<"u"?document.fonts:void 0;(Be=He==null?void 0:He.ready)==null||Be.then(_e).catch(()=>{});const Ae=new ResizeObserver(_e);return Ae.observe(De),()=>Ae.disconnect()},[R.fontFamily,R.fontWeight,R.fontStyle,R.fontSize,R.lineHeight]),s.useLayoutEffect(()=>{if(!O)return;const De=me.current,_e=te.current;if(!De||!_e)return;const He={id:0},Ae=()=>{const ot=De.offsetWidth||De.getBoundingClientRect().width,Ct=_e.offsetWidth||_e.getBoundingClientRect().width;if($&&ot>0&&Ct>0){const rt=Ct/z;if(rt>0){let St=ot,nt=ly;if(_){const ht=ot*ie.current,Vt=oe.current,Zt=Vt>0?2*Math.PI*Vt/ot:0,$e=by(ht,Zt);St=Math.max(ot,$e*ot/($c-1)),nt=cy}const Rt=Math.min(nt,Math.max(is,Math.ceil(St/rt)+1));if(Rt!==z){B(Rt);return}}}Ct>0&&l(Ct)},Be=()=>{cancelAnimationFrame(He.id),He.id=requestAnimationFrame(Ae)};Be();const Ie=new ResizeObserver(Be);Ie.observe(De),Ie.observe(_e);const mt=()=>{document.hidden||Be()};return document.addEventListener("visibilitychange",mt),window.addEventListener("pageshow",mt),window.addEventListener("focus",mt),()=>{cancelAnimationFrame(He.id),Ie.disconnect(),document.removeEventListener("visibilitychange",mt),window.removeEventListener("pageshow",mt),window.removeEventListener("focus",mt)}},[O,he,z,$,le,_,T,L]),s.useLayoutEffect(()=>{const De=fe.current;if(!De)return;const _e={id:0},He=()=>{const Be=De.offsetHeight;Be>0&&re(Ie=>Math.abs(Ie-Be)>.5?Be:Ie)};_e.id=requestAnimationFrame(He);const Ae=new ResizeObserver(()=>{cancelAnimationFrame(_e.id),_e.id=requestAnimationFrame(He)});return Ae.observe(De),()=>{cancelAnimationFrame(_e.id),Ae.disconnect()}},[N,n]),s.useLayoutEffect(()=>{if(!_){Se(0),Z(0);return}const De=me.current,_e=te.current;if(!De||!_e)return;const He={id:0},Ae=()=>{const Ie=De.offsetWidth,mt=_e.offsetHeight;Ie>0&&Z(ot=>Math.abs(ot-Ie)>.5?Ie:ot),mt>0&&Se(ot=>Math.abs(ot-mt)>.5?mt:ot)};He.id=requestAnimationFrame(Ae);const Be=new ResizeObserver(()=>{cancelAnimationFrame(He.id),He.id=requestAnimationFrame(Ae)});return Be.observe(De),Be.observe(_e),()=>{cancelAnimationFrame(He.id),Be.disconnect()}},[_,he,le,F,O]),s.useLayoutEffect(()=>{if(!O||c<=0)return;const De=ue.current;De&&gy(De)},[O,c,u,U]),s.useLayoutEffect(()=>{if(!_||!$)return;const De=me.current;if(!De)return;const _e={raf:0,cancelled:!1,lut:null,lutKey:"",itemsCache:[],cacheDirty:!0},He=()=>{for(const rt of _e.itemsCache)for(const St of rt.glyphs)Cc(St.inner)},Ae=()=>{const rt=C.current??De;_e.itemsCache=Array.from(De.querySelectorAll("[data-marquee-text-item]"),St=>{const nt=[];return St.querySelectorAll("[data-marquee-wave-node]").forEach(Rt=>{const ht=Rt.firstElementChild;ht&&nt.push({inner:ht,layoutLocalX:xy(Rt,rt)})}),{item:St,glyphs:nt}}),_e.cacheDirty=!1},Be=()=>{_e.cacheDirty&&Ae();const St=(C.current??De).offsetWidth||1,nt=St*ie.current,Rt=oe.current,ht=2*Math.PI*Rt/St,Vt=`${St}|${nt}|${ht}`;if(Vt!==_e.lutKey&&(_e.lutKey=Vt,_e.lut=tp(nt,ht,ep)),Math.abs(nt)<=0||ht<=0){He();return}const Zt=ue.current,$e=Zt?vy(getComputedStyle(Zt).transform):0,Ge=De.getBoundingClientRect(),ft=Ge.left,Lt=Ge.right,wt=_e.lut&&_e.lut.wavelength>0?Math.max(0,(_e.lut.periodArc/_e.lut.wavelength-1)*St):0;for(const{item:vt,glyphs:Nt}of _e.itemsCache){const Wt=vt.getBoundingClientRect();if(Wt.right<ft||Wt.left>Lt+wt){for(const Dt of Nt)Cc(Dt.inner);continue}for(const Dt of Nt){const Me=Dt.layoutLocalX+$e,ct=_e.lut?Sy(_e.lut,Me):Me,dt=ht*ct,kt=nt*Math.sin(dt),Ke=nt*ht*Math.cos(dt),st=Math.atan(Ke)*(180/Math.PI);yy(Dt.inner,ct-Me,kt,st)}}},Ie=()=>{_e.cancelled||(_e.raf=0,Be(),de.current&&!document.hidden&&(_e.raf=requestAnimationFrame(Ie)))},mt=()=>{_e.cancelled||_e.raf||(_e.raf=requestAnimationFrame(Ie))},ot=()=>{_e.cacheDirty=!0,Be(),mt()};we.current=mt,V.current=ot,Be(),mt();const Ct=()=>{if(document.hidden){cancelAnimationFrame(_e.raf),_e.raf=0;return}cancelAnimationFrame(_e.raf),_e.raf=0,ot()};return document.addEventListener("visibilitychange",Ct),window.addEventListener("pageshow",Ct),window.addEventListener("focus",Ct),()=>{_e.cancelled=!0,we.current=null,V.current=null,cancelAnimationFrame(_e.raf),document.removeEventListener("visibilitychange",Ct),window.removeEventListener("pageshow",Ct),window.removeEventListener("focus",Ct),He()}},[_,$]),s.useLayoutEffect(()=>{var De;!_||!$||(De=V.current)==null||De.call(V)},[_,$,r,he,z,le,T,L,g]),s.useLayoutEffect(()=>{var De;(De=we.current)==null||De.call(we)},[pe,u]);const ee=De=>{E&&De.pointerType==="mouse"&&Q(!0)},H=()=>{E&&Q(!1)},be=_?Math.abs(T)*100:0,ae=I(N),W={minHeight:ae,..._?{paddingTop:`${be}%`,paddingBottom:`${be}%`}:{}},ke={height:ae,..._?{visibility:"hidden"}:{backgroundColor:X}},ze={gap:I(y),minHeight:ae},Xe=g*T,Ue=Math.abs(Xe),Qe=J>0?J:Ce,We=Math.max(Ce,Qe),it=Ue+We/2,ye=Math.max(Qe,1),Te=_&&g>0&&We>0?wy(g,Xe,L,it,ye):"",Ve=Ue*2+We,Ze=Te?a.jsx("svg",{className:`${o}-curve-bg`,viewBox:`0 0 ${g} ${Ve}`,preserveAspectRatio:"none","aria-hidden":!0,children:a.jsx("path",{d:Te,fill:"none",stroke:X,strokeWidth:Qe,strokeLinecap:"butt",strokeLinejoin:"round"})}):null,et=a.jsx("div",{ref:fe,className:`${o}-ribbon`,style:ke,"aria-hidden":!0}),at={...R,lineHeight:le>0?`${le}px`:`${pa}em`},tt=(De,_e,He)=>a.jsx($y,{item:De,prefix:o,textCss:at,capHeightPx:le,opticalOffsetY:Fe,imageGapPx:I(y),isCurve:_},`${_e}-${He}`),Ye=a.jsx("span",{ref:Pe,"aria-hidden":!0,className:`${o}-cap-ref`,style:R,children:"H"}),xt=`${Math.max(0,k)/1e3}s`,pt=O?a.jsx("div",{ref:ue,className:`${o}-marquee-track`,"data-direction":u,onPointerEnter:ee,onPointerLeave:H,style:{WebkitAnimationDuration:xt,animationDuration:xt,WebkitAnimationPlayState:q,animationPlayState:q},children:Array.from({length:ce},(De,_e)=>a.jsx("div",{ref:_e===0?te:void 0,className:`${o}-marquee-set`,style:{...ze,paddingRight:I(y)},"aria-hidden":_e>0,children:ne.map((He,Ae)=>tt(He,_e,Ae))},`set-${_e}`))}):a.jsx("div",{ref:te,className:Et(`${o}-marquee-set`,`${o}-marquee-static`),style:ze,children:t==null?void 0:t.map((De,_e)=>tt(De,0,_e))});return a.jsxs("div",{ref:me,className:`${o}-wrapper`,"aria-label":"Marquee text",children:[a.jsx("style",{dangerouslySetInnerHTML:{__html:Y}}),Ye,a.jsxs("div",{ref:C,className:`${o}-marquee-wrapper`,style:W,children:[et,Ze,pt]})]})},Ty=`import { useLayoutEffect, useMemo, useRef, useState, type CSSProperties, type PointerEvent as ReactPointerEvent } from 'react';
|
|
2656
2656
|
import cn from 'classnames';
|
|
2657
2657
|
import { CommonComponentProps } from '../props';
|
|
2658
2658
|
import { LinkWrapper, scalingValue, useScopedStyles, type ContentLink } from '../utils/index';
|
|
@@ -5301,7 +5301,7 @@ type TestimonialsSettings = {
|
|
|
5301
5301
|
left: 50%;
|
|
5302
5302
|
transform: translate(-50%, -50%);
|
|
5303
5303
|
}
|
|
5304
|
-
`}function Gy(){return Math.random()<.5?"ltr":"ttb"}function Xy(e){const t=e.Components.Autoplay;t&&(t.pause(!1),t.play())}function Uy(e){const t=Gy();e.options.direction!==t&&(e.options={...e.options,direction:t}),requestAnimationFrame(()=>{requestAnimationFrame(()=>{Xy(e)})})}const Nn=500,qy=750,hi="cubic-bezier(0.22, 1, 0.36, 1)",Ky=72,Yy=50;function Qy(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 Zy(e){const[t,n]=e.media;return n!=null&&n.assetId?n:t!=null&&t.assetId?t:null}function Jy(e){const[t]=e.media;return t!=null&&t.assetId?t:null}function np(e){return!Array.isArray(e)||e.length===0?[]:Qy(e)?e.flatMap(t=>{const n=Zy(t);if(!n)return[];const i=Jy(t);return[{displayMedia:n,lightboxMedia:i!=null&&i.assetId?i:null}]}):e.filter(t=>t==null?void 0:t.assetId).map(t=>({displayMedia:t,lightboxMedia:t}))}function Ki(e){return!b.isEmbedMedia(e)&&e.type==="video"}function ev(e){const t=new Set,n=[];for(const i of e){const o=np(i.gallery);for(const r of o){const l=r.lightboxMedia;l!=null&&l.assetId&&!t.has(l.assetId)&&(t.add(l.assetId),n.push(l))}}return n}function tv({mediaList:e}){const t=e.filter(n=>!b.isEmbedMedia(n));return t.length===0?null:a.jsx("div",{"aria-hidden":!0,style:{position:"absolute",width:0,height:0,overflow:"hidden",opacity:0,pointerEvents:"none"},children:t.map(n=>Ki(n)?a.jsx("video",{src:n.assetId,preload:"auto",muted:!0,playsInline:!0},n.assetId):a.jsx("img",{src:n.assetId,alt:""},n.assetId))})}function nv(e){e.pause(),e.removeAttribute("src"),e.load()}function Mc({media:e,className:t,style:n,hasLightbox:i,onMediaClick:o}){return b.isEmbedMedia(e)?a.jsx(b.EmbedMediaFrame,{media:e,fit:n.objectFit==="contain"?"contain":"cover",silentLoop:i,className:t,style:{...n,cursor:o?"pointer":"default"},onClick:o}):Ki(e)?a.jsx("video",{src:e.assetId,className:t,style:{...n,cursor:o?"pointer":"default"},muted:!0,autoPlay:!0,loop:!0,playsInline:!0,onClick:o}):a.jsx("img",{src:e.assetId,alt:e.name,className:t,style:{...n,cursor:o?"pointer":"default"},onClick:o})}function Ec(e){const t=e.getBoundingClientRect();return{width:t.width,height:t.height,left:t.left,top:t.top}}function iv(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 ov({src:e,mediaRef:t,mediaStyle:n,onLoadedMetadata:i}){return s.useEffect(()=>{const o=t.current;if(o)return()=>{nv(o)}},[e,t]),a.jsx("video",{ref:t,src:e,muted:!0,autoPlay:!0,loop:!0,playsInline:!0,preload:"auto",onLoadedMetadata:i,style:n})}const rv="https://cdn.cntrl.site/component-assets/defaultCloseIcon.svg",av=.004;function sv({prefix:e,closeIcon:t=rv,closeIconMaxWidth:n=.0125,closeIconColor:i="#FFFFFF",closeIconHoverColor:o="#999999",iconMarginRight:r=.01,contentMarginTop:l=.01,isEditor:c,isPreviewMode:d,isEditMode:u,visible:p,onClose:y}){if(!t)return null;const S=b.scalingValue(n,c),m=b.scalingValue(r,c),h=b.scalingValue(l,c),x=b.scalingValue(Math.max(l,av),c);return a.jsxs("div",{style:{position:"absolute",top:0,left:0,right:0,zIndex:1e4,display:"flex",flexDirection:"column",alignItems:"flex-end",pointerEvents:"none",opacity:p?1:0,transition:"opacity 500ms cubic-bezier(0.22, 1, 0.36, 1)"},children:[a.jsx("div",{style:{position:"relative",width:"100%",height:h,flexShrink:0},children:u&&a.jsx("div",{"data-controls":"contentMarginTop","data-controls-axis":"y","data-controls-min":"0",className:`${e}-control`,style:{position:"absolute",top:0,left:0,width:"100%",height:x,pointerEvents:p?"auto":"none"}})}),a.jsxs("div",{className:`${e}-close-icon`,style:{width:S,height:S,marginRight:m,pointerEvents:p?"auto":"none"},onClick:w=>w.stopPropagation(),children:[a.jsx("button",{type:"button",className:`${e}-close-icon-inner`,"aria-label":"Close",onClick:w=>{w.stopPropagation(),y()},children:a.jsx(mn,{url:t,fill:i,hoverFill:c&&!d?i:o,className:`${e}-close-icon-img`})}),u&&a.jsx("div",{"data-controls":"iconMarginRight","data-controls-axis":"x","data-controls-reverse":"",className:`${e}-control`,style:{position:"absolute",top:0,left:"100%",width:m,height:"100%",pointerEvents:p?"auto":"none"}})]})]})}function lv({prefix:e,items:t,index:n,imageDisplay:i,isEditor:o,isPreviewMode:r,isEditMode:l,onClose:c,onPrev:d,onNext:u,counterClassName:p,counterStyle:y,closeIcon:S,closeIconMaxWidth:m,closeIconColor:h,closeIconHoverColor:x,iconMarginRight:w,contentMarginTop:F}){const v=i==="cover",P=s.useRef(null),M=s.useRef(null),K=s.useRef(null),X=s.useRef(null),j=s.useRef(0),N=s.useRef(0),_=s.useRef("none"),T=s.useRef(!1),L=s.useRef(!1),Y=s.useRef(null),R=s.useRef(0),I=s.useRef(null),$=s.useRef(!1),G=s.useRef(null),O=s.useRef(null),U=s.useRef(null),E=s.useRef(()=>{}),[f,Q]=s.useState(null),[q,pe]=s.useState(null),[k,me]=s.useState("opening"),[C,ue]=s.useState(0),[te,fe]=s.useState(0),[Pe,de]=s.useState(null),[we,V]=s.useState(!1),[ie,oe]=s.useState(!1),[le,ve]=s.useState(!1),[Fe,Ee]=s.useState(null),Ce=s.useRef(n),Se=s.useRef(void 0),g=t[n],Z=g?Ki(g):!1,J=g?b.isEmbedMedia(g):!1,re=Pe!==null,he=s.useCallback(He=>{const Ae=He.currentTarget,Be=Ae instanceof HTMLVideoElement?{width:Ae.videoWidth,height:Ae.videoHeight}:{width:Ae.naturalWidth,height:Ae.naturalHeight};!Be.width||!Be.height||Ee(Be)},[]);s.useEffect(()=>{Y.current=q},[q]),s.useEffect(()=>{const He=P.current;if(!He)return;const Ae=()=>pe(Ec(He));Ae();const Be=new ResizeObserver(Ae);return Be.observe(He),()=>Be.disconnect()},[]);const z=s.useCallback(()=>{G.current!==null&&(window.clearTimeout(G.current),G.current=null)},[]),B=s.useCallback(()=>{const He=O.current;O.current=null,z(),I.current=null,$.current=!1,de(null),V(!1),fe(0),R.current=0,oe(!1),T.current=!1,N.current=0,_.current="none",He===1?u():He===-1&&d()},[z,u,d]),ne=s.useCallback(()=>{z(),O.current=null,I.current=null,$.current=!1,de(null),V(!1),fe(0),R.current=0},[z]),ce=s.useCallback(()=>{z(),G.current=window.setTimeout(()=>{O.current!==null&&B()},Nn+32)},[z,B]),ee=s.useCallback((He,Ae)=>{var Ie;const Be=((Ie=Y.current)==null?void 0:Ie.width)??0;if(z(),I.current=He,de(He),$.current=!0,V(!0),Ae){O.current=He;const mt=-He*Be;R.current=mt,fe(mt),ce();return}R.current=0,fe(0),G.current=window.setTimeout(()=>{G.current=null,ne()},Nn+32)},[z,ne,ce]),H=s.useCallback(He=>{if(!(t.length<=1)){if($.current){if(O.current===He){U.current=He,B();return}ne()}z(),I.current=He,de(He),$.current=!1,V(!1),R.current=0,fe(0),requestAnimationFrame(()=>{requestAnimationFrame(()=>{ee(He,!0)})})}},[t.length,ee,B,ne,z]);E.current=H;const be=s.useCallback(He=>{He.propertyName!=="transform"||!$.current||O.current!==null&&B()},[B]),ae=s.useCallback(()=>{const He=M.current;if(!He)return;const Ae=Ec(He);!Ae.width||!Ae.height||Q(Ae)},[]);s.useEffect(()=>{ae();const He=M.current;if(!He)return;const Ae=new ResizeObserver(()=>ae());return Ae.observe(He),()=>Ae.disconnect()},[ae]),s.useEffect(()=>{k==="opening"&&f&&me("open")},[k,f]),s.useEffect(()=>{if(k!=="closing")return;const He=setTimeout(()=>c(),Nn);return()=>clearTimeout(He)},[k,c]),s.useEffect(()=>()=>{z()},[z]),s.useLayoutEffect(()=>{Ce.current===n&&Se.current===(g==null?void 0:g.assetId)||(z(),O.current=null,de(null),ue(0),fe(0),V(!1),ve(!1),oe(!1),Ee(null),j.current=0,N.current=0,_.current="none",T.current=!1,$.current=!1,R.current=0,I.current=null,X.current=null,L.current=!1,Ce.current=n,Se.current=g==null?void 0:g.assetId)},[n,g==null?void 0:g.assetId,z]),s.useLayoutEffect(()=>{const He=U.current;He!==null&&(U.current=null,requestAnimationFrame(()=>{E.current(He)}))},[n,g==null?void 0:g.assetId]),s.useEffect(()=>{if(k!=="open")return;let He=null;const Ae=()=>{He&&(document.removeEventListener("click",He,!0),He=null)},Be=()=>{Ae(),He=rt=>{rt.stopPropagation(),rt.preventDefault(),Ae()},document.addEventListener("click",He,!0)},Ie=rt=>{const St=rt<0?1:-1;if(Math.abs(rt)>Yy&&t.length>1){ee(St,!0);return}ee(St,!1)},mt=rt=>{if(rt.touches.length!==1||$.current)return;const St=rt.touches[0];L.current=!0,X.current={x:St.clientX,y:St.clientY},_.current="none",N.current=0,T.current=!1},ot=rt=>{if(!X.current||rt.touches.length!==1||$.current)return;const St=rt.touches[0],nt=St.clientX-X.current.x,Rt=St.clientY-X.current.y;if(_.current==="none"){if(Math.abs(nt)<10&&Math.abs(Rt)<10)return;if(Math.abs(nt)>Math.abs(Rt)){if(t.length<=1)return;_.current="horizontal"}else if(Rt>0)_.current="vertical";else return}if(_.current==="horizontal"){T.current=!0,oe(!0),N.current=nt;const ht=nt<0?1:-1;I.current!==ht&&(I.current=ht,de(ht)),R.current=nt,fe(nt),rt.preventDefault();return}_.current==="vertical"&&(T.current=!0,oe(!0),j.current=Rt,ue(Rt),rt.preventDefault())},Ct=()=>{if(!X.current)return;const rt=_.current,St=T.current;if(St&&rt==="horizontal")Ie(N.current),Be();else if(St&&rt==="vertical")if(j.current>Ky){const Rt=window.innerHeight;j.current=Rt,ve(!0),ue(Rt),me("closing")}else j.current=0,ue(0),Be();else rt==="horizontal"&&Math.abs(N.current)>0&&(Ie(N.current),Be());X.current=null,_.current="none",N.current=0,T.current=!1,oe(!1)};return document.addEventListener("touchstart",mt,{passive:!0}),document.addEventListener("touchmove",ot,{passive:!1}),document.addEventListener("touchend",Ct),document.addEventListener("touchcancel",Ct),()=>{document.removeEventListener("touchstart",mt),document.removeEventListener("touchmove",ot),document.removeEventListener("touchend",Ct),document.removeEventListener("touchcancel",Ct),Ae()}},[k,t.length,ee]),s.useEffect(()=>{const He=Ae=>{Ae.key==="Escape"&&(Ae.preventDefault(),Ae.stopPropagation(),k!=="closing"&&me("closing"))};return window.addEventListener("keydown",He,!0),()=>window.removeEventListener("keydown",He,!0)},[k]);const W=()=>{k!=="closing"&&me("closing")},ke=k==="open",ze=k==="closing",Xe=C>0?Math.max(0,1-C/500):1,Ue=C>0?Math.max(.35,1-C/500):1,Qe=J&&g?{width:b.getEmbedAspect(g),height:1}:Fe,We=f?v?f:iv(f,Qe):null,it={position:"fixed",top:q==null?void 0:q.top,left:q==null?void 0:q.left,width:q==null?void 0:q.width,height:q==null?void 0:q.height,zIndex:9998},ye=v?"cover":"contain",Te=te!==0||C>0?`translate(${te}px, ${C}px)`:void 0,Ve=ie&&!we?"none":we?`transform ${Nn}ms ${hi}`:le?`transform ${Nn}ms ${hi}, opacity ${Nn}ms ${hi}`:k==="opening"||ze?`opacity ${Nn}ms ${hi}`:"none",Ze={...it,transform:Te,opacity:C>0?Ue:k==="opening"||ze?0:1,transition:Ve,pointerEvents:"none"},et={position:"absolute",top:((We==null?void 0:We.top)??0)-((q==null?void 0:q.top)??0),left:((We==null?void 0:We.left)??0)-((q==null?void 0:q.left)??0),width:We==null?void 0:We.width,height:We==null?void 0:We.height,objectFit:ye,pointerEvents:"none"},at=(q==null?void 0:q.width)??0,tt=re?(n+Pe+t.length)%t.length:null,Ye=tt!==null?t[tt]:null,xt={...it,transform:re?`translateX(${Pe*at+te}px)`:void 0,opacity:1,transition:we?`transform ${Nn}ms ${hi}`:"none",pointerEvents:"none"},pt={position:"absolute",top:((f==null?void 0:f.top)??0)-((q==null?void 0:q.top)??0),left:((f==null?void 0:f.left)??0)-((q==null?void 0:q.left)??0),width:f==null?void 0:f.width,height:f==null?void 0:f.height,objectFit:ye,pointerEvents:"none"},De=J&&g&&b.getEmbedPlayback(g).controls&&We?Math.min(52,We.height*.2):0,_e=We?{position:"fixed",top:We.top,height:We.height-De,width:We.width/2,zIndex:9999}:null;return a.jsxs("div",{ref:P,className:[`${e}-lightbox`,o?`${e}-lightbox-editor`:""].filter(Boolean).join(" "),style:{touchAction:k==="open"?"none":void 0},onClick:W,children:[a.jsx("div",{style:{position:"absolute",inset:0,background:"rgba(28,31,34,0.9)",opacity:ke?Xe:0,transition:ie?"none":`opacity ${Nn}ms ${hi}`,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:M,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:ke?1:0,transition:`opacity ${Nn}ms ${hi}`,pointerEvents:"none",zIndex:9999},children:t.length>1&&a.jsxs("p",{className:p,style:y,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:M,style:{width:"100%",height:"100%"}})}),a.jsx("div",{style:{display:"flex",flexDirection:"row",justifyContent:"center",alignItems:"center",height:"10%",opacity:ke?1:0,transition:`opacity ${Nn}ms ${hi}`},children:t.length>1&&a.jsxs("p",{className:p,style:y,children:[n+1," / ",t.length]})})]})}),f&&q&&Ye&&a.jsx("div",{style:xt,onTransitionEnd:be,children:b.isEmbedMedia(Ye)?a.jsx("img",{src:Ye.thumbnail,alt:Ye.name,style:pt},`neighbor-${tt}-${Ye.assetId}`):Ki(Ye)?a.jsx("video",{src:Ye.assetId,muted:!0,autoPlay:!0,loop:!0,playsInline:!0,preload:"auto",style:pt},`neighbor-${tt}-${Ye.assetId}`):a.jsx("img",{src:Ye.assetId,alt:Ye.name,style:pt},`neighbor-${tt}-${Ye.assetId}`)}),f&&q&&g&&a.jsx("div",{style:Ze,onTransitionEnd:be,children:J?a.jsx(b.EmbedMediaFrame,{media:g,fit:v?"cover":"contain",lazy:!1,startsAtOnce:!0,style:et},`${n}-${g.assetId}`):Z?a.jsx(ov,{src:g.assetId,mediaRef:K,mediaStyle:et,onLoadedMetadata:he},`${n}-${g.assetId}`):a.jsx("img",{ref:K,src:g.assetId,alt:g.name,onLoad:he,style:et},`${n}-${g.assetId}`)}),ke&&_e&&t.length>1&&a.jsxs(a.Fragment,{children:[a.jsx("div",{style:{..._e,left:We.left,cursor:"w-resize",pointerEvents:ie?"none":"auto"},onClick:He=>{if(L.current){L.current=!1;return}He.stopPropagation(),H(-1)}}),a.jsx("div",{style:{..._e,left:We.left+We.width/2,cursor:"e-resize",pointerEvents:ie?"none":"auto"},onClick:He=>{if(L.current){L.current=!1;return}He.stopPropagation(),H(1)}})]}),a.jsx(sv,{prefix:e,closeIcon:S,closeIconMaxWidth:m,closeIconColor:h,closeIconHoverColor:x,iconMarginRight:w,contentMarginTop:F,isEditor:o,isPreviewMode:r,isEditMode:l,visible:ke,onClose:W})]})}function cv(e){return typeof e=="string"?e==="cover"?"cover":"fit":(e==null?void 0:e.display)==="cover"?"cover":"fit"}function dv({settings:e,content:t,isEditor:n,isPreviewMode:i,isEditMode:o,metadata:r,activeEvent:l,layoutId:c,portalId:d}){const{prefix:u}=b.useScopedStyles(),{type:p="a",gridLayout:y,textBoxWidth:S=100,verticalGap:m,entriesCount:h,lightbox:x,imageDisplay:w,imageCorners:F,lightboxImageDisplay:v,slider:P,sliderTiming:M,direction:K,transition:X,titleMarginTop:j,subtitleMarginTop:N,titleColor:_,subtitleColor:T,lightboxCounterColor:L,titleFontFamily:Y,titleFontSettings:R,titleFontSize:I,titleLineHeight:$,titleLetterSpacing:G,titleWordSpacing:O,titleTextAppearance:U,subtitleFontFamily:E,subtitleFontSettings:f,subtitleFontSize:Q,subtitleLineHeight:q,subtitleLetterSpacing:pe,subtitleWordSpacing:k,subtitleTextAppearance:me,lightboxCounterFontFamily:C,lightboxCounterFontSettings:ue,lightboxCounterFontSize:te,lightboxCounterLineHeight:fe,lightboxCounterLetterSpacing:Pe,lightboxCounterWordSpacing:de,lightboxCounterTextAppearance:we,closeIcon:V,closeIconMaxWidth:ie,closeIconColor:oe,closeIconHoverColor:le,iconMarginRight:ve,contentMarginTop:Fe,showText:Ee="always",alignEntries:Ce="off",align:Se="top"}=e,g={fontSettings:{fontFamily:Y,fontWeight:(R==null?void 0:R.fontWeight)??400,fontStyle:(R==null?void 0:R.fontStyle)??"normal"},fontSize:I??.01,lineHeight:$,letterSpacing:G??0,wordSpacing:O??0,textAppearance:U,color:_},J={...pn(nn(g,n))},re={fontSettings:{fontFamily:E,fontWeight:(f==null?void 0:f.fontWeight)??400,fontStyle:(f==null?void 0:f.fontStyle)??"normal"},fontSize:Q??.01,lineHeight:q,letterSpacing:pe??0,wordSpacing:k??0,textAppearance:me,color:T},z={...pn(nn(re,n))},B={fontSettings:{fontFamily:C,fontWeight:(ue==null?void 0:ue.fontWeight)??400,fontStyle:(ue==null?void 0:ue.fontStyle)??"normal"},fontSize:te??.01,lineHeight:fe,letterSpacing:Pe??0,wordSpacing:de??0,textAppearance:we,color:L},ce={...pn(nn(B,n)),...rs(te,fe,u,n)},ee=os(I,$,`${u}-item-title`,`${u}-text-tight-leading`),H=os(Q,q,`${u}-item-subtitle`,`${u}-text-tight-leading`),be=rs(I,$,u,n),ae=rs(Q,q,u,n),W=os(te,fe,`${u}-lightbox-counter`,`${u}-text-tight-leading`),ke=b.buildColorVars(u,{titleColor:_,subtitleColor:T,lightboxCounterColor:L},uv,pv),Ue=`${l&&l!=="default"?`${u}-state-${l}`:""}${Ee==="on hover"&&(!n||i)?` ${u}-show-text-hover`:""}`.trim(),Qe=h===0?1/0:h,We=(t??[]).slice(0,Qe),it=s.useMemo(()=>x==="on"?ev(We):[],[We,x]),ye=y.entryWidth??.2,Te=(w==null?void 0:w.display)==="cover",Ve=(w==null?void 0:w.ratioValue)??"1:1",Ze=(w==null?void 0:w.reversed)??!1,[et,at]=Ve.split(":").map(Number),xt=`${Ze?at:et} / ${Ze?et:at}`,pt=y.columnsCount,De=b.scalingValue(ye??0,n),_e=De,He=!Te&&P!=="off",Ae=We.length%pt||pt,Be=Ae<pt&&We.length>0,Ie=We.length-Ae,mt=Be?Math.floor((pt-Ae)/2)+1:1,ot=F?b.scalingValue(F,n):void 0,Ct={width:_e,...Te?{aspectRatio:xt,height:"auto",overflow:"hidden"}:{height:"auto"},...ot?{borderRadius:ot,overflow:"hidden"}:{}},rt=`${u}-item-image-wrapper${He?` ${u}-item-image-wrapper-fit-slider`:""}`.trim(),St=p==="d"||p==="e"||p==="f",nt=Ce==="on",Rt=`calc(${b.scalingValue(ye??0,n)} * (${S} / 100))`,ht=b.scalingValue(ye*S/100,n),Gt=Te?{objectFit:"cover",pointerEvents:"auto",width:"100%",height:"100%",maxWidth:"100%",...ot?{borderRadius:ot}:{}}:{objectFit:"contain",pointerEvents:"auto",width:"auto",height:"auto",maxWidth:"100%",...ot?{borderRadius:ot}:{}},[Zt,$e]=s.useState(0),Ge=s.useRef(null),ft=X==="fade"||K==="horizontal"?"ltr":K==="vertical"?"ttb":"ltr";s.useEffect(()=>{const Ke=Ge.current;if(!Ke)return;const st=new ResizeObserver(It=>{$e(Math.round(It[0].contentRect.width))});return st.observe(Ke),()=>st.disconnect()},[]);const Lt=(()=>{const Ke={...ke},st=Ge.current?getComputedStyle(Ge.current).getPropertyValue("--cntrl-article-width").trim():"";return st&&(Ke["--cntrl-article-width"]=st),Ke})(),[wt,vt]=s.useState(!1),[Nt,Wt]=s.useState([]),[Dt,Me]=s.useState(0),ct=x==="on"&&(!n||i),dt=(Ke,st)=>{n&&!i||x!=="off"&&(Wt(Ke),Me(st),vt(!0))};s.useEffect(()=>{if(!wt||x!=="on"||typeof document>"u")return;const Ke=document.body.style.overflow;return document.body.style.overflow="hidden",()=>{document.body.style.overflow=Ke}},[wt,x]),s.useEffect(()=>{!n||i||vt(!1)},[n,i]);const kt=s.useMemo(()=>Vy(u),[u]);return a.jsxs(a.Fragment,{children:[a.jsx("style",{dangerouslySetInnerHTML:{__html:kt}}),x==="on"&&a.jsx(tv,{mediaList:it}),a.jsx("div",{style:ke,children:a.jsx("div",{ref:Ge,className:`${u}-wrapper ${u}-type-${p}${nt?` ${u}-align-entries`:""} ${u}-image-align-${Se} ${Ue}`.trim(),style:{gridTemplateColumns:`repeat(${pt}, ${De})`,rowGap:nt?0:b.scalingValue(m??0,n),columnGap:b.scalingValue(y.horizontalGap??0,n),width:b.scalingValue(y.wrapperWidth??0,n),...nt?{[`--${u}-align-entries-row-gap`]:b.scalingValue(m??0,n)}:{}},children:We.map((Ke,st)=>{var yt;const It=Pc(Ke.title),At=Pc(Ke.subtitle),ut=x==="off"&&((yt=Ke.link)!=null&&yt.value)?Ke.link:void 0,Xt=Math.floor(st/pt)===Math.ceil(We.length/pt)-1,Ut=Be&&st>=Ie?`${mt+(st-Ie)}`:void 0,Ot=St?a.jsxs("div",{className:`${u}-item-text-block`,children:[It&&a.jsx("p",{className:ee,style:{width:Rt,...J,...be},children:Ke.title}),It&&a.jsx("div",{"data-controls":o?"titleMarginTop":void 0,className:o?`${u}-control`:void 0,style:{height:b.scalingValue(j??0,n),width:ht}}),At&&a.jsx("p",{className:H,style:{width:Rt,...z,...ae},children:Ke.subtitle}),At&&a.jsx("div",{"data-controls":o?"subtitleMarginTop":void 0,className:o?`${u}-control`:void 0,style:{height:b.scalingValue(N??0,n),width:ht}})]}):null,Bt=nt?a.jsxs("div",{className:`${u}-item-title-row`,children:[!St&&a.jsx("div",{"data-controls":o&&It?"titleMarginTop":void 0,className:o&&It?`${u}-control`:void 0,style:{height:It?b.scalingValue(j??0,n):0,width:ht}}),It&&a.jsx("p",{className:ee,style:{width:Rt,...J,...be},children:Ke.title}),St&&It&&a.jsx("div",{"data-controls":o?"titleMarginTop":void 0,className:o?`${u}-control`:void 0,style:{height:b.scalingValue(j??0,n),width:ht}})]}):null,jt=nt?a.jsxs("div",{className:`${u}-item-subtitle-row`,children:[!St&&a.jsx("div",{"data-controls":o&&At?"subtitleMarginTop":void 0,className:o&&At?`${u}-control`:void 0,style:{height:At?b.scalingValue(N??0,n):0,width:ht}}),At&&a.jsx("p",{className:H,style:{width:Rt,...z,...ae},children:Ke.subtitle}),St&&At&&a.jsx("div",{"data-controls":o?"subtitleMarginTop":void 0,className:o?`${u}-control`:void 0,style:{height:b.scalingValue(N??0,n),width:ht}})]}):null,zt=a.jsxs(b.LinkWrapper,{link:ut,className:`${u}-item-text-link`,children:[Bt,jt]}),Kt=np(Ke.gallery),D=Kt.filter(Tt=>Tt.lightboxMedia).map(Tt=>Tt.lightboxMedia),Le=a.jsx("div",{className:rt,style:Ct,children:Kt.length===0?null:P==="off"?(()=>{const{displayMedia:Tt,lightboxMedia:Je}=Kt[0],Pt=Je?D.findIndex($t=>$t.assetId===Je.assetId):-1;return a.jsx(Mc,{media:Tt,className:`${u}-item-${Ki(Tt)?"video":"image"}`.trim(),style:Gt,hasLightbox:x==="on",onMediaClick:ct&&Pt>=0?()=>dt(D,Pt):void 0})})():a.jsxs(a.Fragment,{children:[He&&a.jsx("div",{className:`${u}-item-image-wrapper-sizer`,"aria-hidden":"true",children:Kt.map(({displayMedia:Tt})=>b.isEmbedMedia(Tt)?a.jsx("div",{style:{aspectRatio:`${b.getEmbedAspect(Tt)}`}},`sizer-${Tt.assetId}`):Ki(Tt)?a.jsx("video",{src:Tt.assetId,muted:!0,playsInline:!0},`sizer-${Tt.assetId}`):a.jsx("img",{src:Tt.assetId,alt:""},`sizer-${Tt.assetId}`))}),a.jsx(kl,{className:`${u}-item-slider`,options:{arrows:!1,pagination:!1,drag:!1,perPage:1,autoplay:!0,interval:M*1e3,width:"100%",height:"100%",speed:qy,type:X==="fade"?"fade":"loop",rewind:X==="fade",pauseOnHover:!1,pauseOnFocus:!1,direction:ft},onMoved:Tt=>{K!=="random"||X==="fade"||Uy(Tt)},children:Kt.map(({displayMedia:Tt,lightboxMedia:Je},Pt)=>{const $t=Je?D.findIndex(_t=>_t.assetId===Je.assetId):-1;return a.jsx(Al,{children:a.jsx(Mc,{media:Tt,className:`${u}-item-${Ki(Tt)?"video":"image"}`.trim(),style:Gt,hasLightbox:x==="on",onMediaClick:ct&&$t>=0?()=>dt(D,$t):void 0})},Pt)})},`${X}-${ye}-${K}-${M}-${Zt}-${c}`)]})}),Ne=St?null:a.jsxs(a.Fragment,{children:[a.jsx("div",{"data-controls":o&&It?"titleMarginTop":void 0,className:o&&It?`${u}-control`:void 0,style:{height:It?b.scalingValue(j??0,n):0,width:ht}}),a.jsx("p",{className:ee,style:{width:Rt,...J,...be},children:Ke.title}),a.jsx("div",{"data-controls":o&&At?"subtitleMarginTop":void 0,className:o&&At?`${u}-control`:void 0,style:{height:At?b.scalingValue(N??0,n):0,width:ht}}),a.jsx("p",{className:H,style:{width:Rt,...z,...ae},children:Ke.subtitle})]}),Oe=ut?a.jsx(b.LinkWrapper,{link:ut,className:`${u}-item-image-link`,children:Le}):a.jsx("a",{className:`${u}-item-image-link`,children:Le});return a.jsx("div",{className:`${u}-item`.trim(),style:Ut&&!nt?{gridColumn:Ut}:void 0,children:a.jsx("div",{className:`${o?`${u}-item-inner`:`${u}-item-inner-hidden`}${nt&&Xt?` ${u}-item-inner-last-row`:""}`.trim(),style:{width:(S??0)>100?`calc(${De} * (${S} / 100))`:De,...Ut&&nt?{gridColumn:Ut}:{}},children:nt?a.jsx(a.Fragment,{children:St?a.jsxs(a.Fragment,{children:[zt,Oe]}):a.jsxs(a.Fragment,{children:[Oe,zt]})}):ut?a.jsxs(a.Fragment,{children:[a.jsxs(b.LinkWrapper,{link:ut,className:`${u}-item-image-link`,children:[Ot,Le]}),!St&&a.jsx(b.LinkWrapper,{link:ut,className:`${u}-item-text-link`,children:Ne})]}):a.jsxs(a.Fragment,{children:[Ot,Le,Ne]})})},st)})})}),(!n||i)&&wt&&typeof document<"u"&&x==="on"&&(()=>{const Ke=(d?document.getElementById(d):null)??document.body;return qn.createPortal(a.jsx("div",{style:Lt,"data-selection":"none",children:a.jsx(lv,{prefix:u,items:Nt,index:Dt,imageDisplay:cv(v),isEditor:n,isPreviewMode:i,isEditMode:o,closeIcon:V,closeIconMaxWidth:ie,closeIconColor:oe,closeIconHoverColor:le,iconMarginRight:ve,contentMarginTop:Fe,onClose:()=>vt(!1),onPrev:()=>Me(st=>(st-1+Nt.length)%Nt.length),onNext:()=>Me(st=>(st+1)%Nt.length),counterClassName:W,counterStyle:ce})}),Ke)})()]})}const uv={titleColor:"title-color",subtitleColor:"subtitle-color",lightboxCounterColor:"lightbox-counter-color"},pv=["hover","focus","filled","success","error"],mv=`import { Splide, SplideSlide } from '@splidejs/react-splide';
|
|
5304
|
+
`}function Gy(){return Math.random()<.5?"ltr":"ttb"}function Xy(e){const t=e.Components.Autoplay;t&&(t.pause(!1),t.play())}function Uy(e){const t=Gy();e.options.direction!==t&&(e.options={...e.options,direction:t}),requestAnimationFrame(()=>{requestAnimationFrame(()=>{Xy(e)})})}const Nn=500,qy=750,hi="cubic-bezier(0.22, 1, 0.36, 1)",Ky=72,Yy=50;function Qy(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 Zy(e){const[t,n]=e.media;return n!=null&&n.assetId?n:t!=null&&t.assetId?t:null}function Jy(e){const[t]=e.media;return t!=null&&t.assetId?t:null}function np(e){return!Array.isArray(e)||e.length===0?[]:Qy(e)?e.flatMap(t=>{const n=Zy(t);if(!n)return[];const i=Jy(t);return[{displayMedia:n,lightboxMedia:i!=null&&i.assetId?i:null}]}):e.filter(t=>t==null?void 0:t.assetId).map(t=>({displayMedia:t,lightboxMedia:t}))}function Ki(e){return!b.isEmbedMedia(e)&&e.type==="video"}function ev(e){const t=new Set,n=[];for(const i of e){const o=np(i.gallery);for(const r of o){const l=r.lightboxMedia;l!=null&&l.assetId&&!t.has(l.assetId)&&(t.add(l.assetId),n.push(l))}}return n}function tv({mediaList:e}){const t=e.filter(n=>!b.isEmbedMedia(n));return t.length===0?null:a.jsx("div",{"aria-hidden":!0,style:{position:"absolute",width:0,height:0,overflow:"hidden",opacity:0,pointerEvents:"none"},children:t.map(n=>Ki(n)?a.jsx("video",{src:n.assetId,preload:"auto",muted:!0,playsInline:!0},n.assetId):a.jsx("img",{src:n.assetId,alt:""},n.assetId))})}function nv(e){e.pause(),e.removeAttribute("src"),e.load()}function Mc({media:e,className:t,style:n,hasLightbox:i,onMediaClick:o}){return b.isEmbedMedia(e)?a.jsx(b.EmbedMediaFrame,{media:e,fit:n.objectFit==="contain"?"contain":"cover",silentLoop:i,className:t,style:{...n,cursor:o?"pointer":"default"},onClick:o}):Ki(e)?a.jsx("video",{src:e.assetId,className:t,style:{...n,cursor:o?"pointer":"default"},muted:!0,autoPlay:!0,loop:!0,playsInline:!0,onClick:o}):a.jsx("img",{src:e.assetId,alt:e.name,className:t,style:{...n,cursor:o?"pointer":"default"},onClick:o})}function Ec(e){const t=e.getBoundingClientRect();return{width:t.width,height:t.height,left:t.left,top:t.top}}function iv(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 ov({src:e,mediaRef:t,mediaStyle:n,onLoadedMetadata:i}){return s.useEffect(()=>{const o=t.current;if(o)return()=>{nv(o)}},[e,t]),a.jsx("video",{ref:t,src:e,muted:!0,autoPlay:!0,loop:!0,playsInline:!0,preload:"auto",onLoadedMetadata:i,style:n})}const rv="https://cdn.cntrl.site/component-assets/defaultCloseIcon.svg",av=.004;function sv({prefix:e,closeIcon:t=rv,closeIconMaxWidth:n=.0125,closeIconColor:i="#FFFFFF",closeIconHoverColor:o="#999999",iconMarginRight:r=.01,contentMarginTop:l=.01,isEditor:c,isPreviewMode:d,isEditMode:u,visible:p,onClose:y}){if(!t)return null;const S=b.scalingValue(n,c),m=b.scalingValue(r,c),h=b.scalingValue(l,c),x=b.scalingValue(Math.max(l,av),c);return a.jsxs("div",{style:{position:"absolute",top:0,left:0,right:0,zIndex:1e4,display:"flex",flexDirection:"column",alignItems:"flex-end",pointerEvents:"none",opacity:p?1:0,transition:"opacity 500ms cubic-bezier(0.22, 1, 0.36, 1)"},children:[a.jsx("div",{style:{position:"relative",width:"100%",height:h,flexShrink:0},children:u&&a.jsx("div",{"data-controls":"contentMarginTop","data-controls-axis":"y","data-controls-min":"0",className:`${e}-control`,style:{position:"absolute",top:0,left:0,width:"100%",height:x,pointerEvents:p?"auto":"none"}})}),a.jsxs("div",{className:`${e}-close-icon`,style:{width:S,height:S,marginRight:m,pointerEvents:p?"auto":"none"},onClick:w=>w.stopPropagation(),children:[a.jsx("button",{type:"button",className:`${e}-close-icon-inner`,"aria-label":"Close",onClick:w=>{w.stopPropagation(),y()},children:a.jsx(mn,{url:t,fill:i,hoverFill:c&&!d?i:o,className:`${e}-close-icon-img`})}),u&&a.jsx("div",{"data-controls":"iconMarginRight","data-controls-axis":"x","data-controls-reverse":"",className:`${e}-control`,style:{position:"absolute",top:0,left:"100%",width:m,height:"100%",pointerEvents:p?"auto":"none"}})]})]})}function lv({prefix:e,items:t,index:n,imageDisplay:i,isEditor:o,isPreviewMode:r,isEditMode:l,onClose:c,onPrev:d,onNext:u,counterClassName:p,counterStyle:y,closeIcon:S,closeIconMaxWidth:m,closeIconColor:h,closeIconHoverColor:x,iconMarginRight:w,contentMarginTop:F}){const v=i==="cover",P=s.useRef(null),M=s.useRef(null),K=s.useRef(null),X=s.useRef(null),j=s.useRef(0),N=s.useRef(0),_=s.useRef("none"),T=s.useRef(!1),L=s.useRef(!1),Y=s.useRef(null),R=s.useRef(0),I=s.useRef(null),$=s.useRef(!1),G=s.useRef(null),O=s.useRef(null),U=s.useRef(null),E=s.useRef(()=>{}),[f,Q]=s.useState(null),[q,pe]=s.useState(null),[k,me]=s.useState("opening"),[C,ue]=s.useState(0),[te,fe]=s.useState(0),[Pe,de]=s.useState(null),[we,V]=s.useState(!1),[ie,oe]=s.useState(!1),[le,ve]=s.useState(!1),[Fe,Ee]=s.useState(null),Ce=s.useRef(n),Se=s.useRef(void 0),g=t[n],Z=g?Ki(g):!1,J=g?b.isEmbedMedia(g):!1,re=Pe!==null,he=s.useCallback(He=>{const Ae=He.currentTarget,Be=Ae instanceof HTMLVideoElement?{width:Ae.videoWidth,height:Ae.videoHeight}:{width:Ae.naturalWidth,height:Ae.naturalHeight};!Be.width||!Be.height||Ee(Be)},[]);s.useEffect(()=>{Y.current=q},[q]),s.useEffect(()=>{const He=P.current;if(!He)return;const Ae=()=>pe(Ec(He));Ae();const Be=new ResizeObserver(Ae);return Be.observe(He),()=>Be.disconnect()},[]);const z=s.useCallback(()=>{G.current!==null&&(window.clearTimeout(G.current),G.current=null)},[]),B=s.useCallback(()=>{const He=O.current;O.current=null,z(),I.current=null,$.current=!1,de(null),V(!1),fe(0),R.current=0,oe(!1),T.current=!1,N.current=0,_.current="none",He===1?u():He===-1&&d()},[z,u,d]),ne=s.useCallback(()=>{z(),O.current=null,I.current=null,$.current=!1,de(null),V(!1),fe(0),R.current=0},[z]),ce=s.useCallback(()=>{z(),G.current=window.setTimeout(()=>{O.current!==null&&B()},Nn+32)},[z,B]),ee=s.useCallback((He,Ae)=>{var Ie;const Be=((Ie=Y.current)==null?void 0:Ie.width)??0;if(z(),I.current=He,de(He),$.current=!0,V(!0),Ae){O.current=He;const mt=-He*Be;R.current=mt,fe(mt),ce();return}R.current=0,fe(0),G.current=window.setTimeout(()=>{G.current=null,ne()},Nn+32)},[z,ne,ce]),H=s.useCallback(He=>{if(!(t.length<=1)){if($.current){if(O.current===He){U.current=He,B();return}ne()}z(),I.current=He,de(He),$.current=!1,V(!1),R.current=0,fe(0),requestAnimationFrame(()=>{requestAnimationFrame(()=>{ee(He,!0)})})}},[t.length,ee,B,ne,z]);E.current=H;const be=s.useCallback(He=>{He.propertyName!=="transform"||!$.current||O.current!==null&&B()},[B]),ae=s.useCallback(()=>{const He=M.current;if(!He)return;const Ae=Ec(He);!Ae.width||!Ae.height||Q(Ae)},[]);s.useEffect(()=>{ae();const He=M.current;if(!He)return;const Ae=new ResizeObserver(()=>ae());return Ae.observe(He),()=>Ae.disconnect()},[ae]),s.useEffect(()=>{k==="opening"&&f&&me("open")},[k,f]),s.useEffect(()=>{if(k!=="closing")return;const He=setTimeout(()=>c(),Nn);return()=>clearTimeout(He)},[k,c]),s.useEffect(()=>()=>{z()},[z]),s.useLayoutEffect(()=>{Ce.current===n&&Se.current===(g==null?void 0:g.assetId)||(z(),O.current=null,de(null),ue(0),fe(0),V(!1),ve(!1),oe(!1),Ee(null),j.current=0,N.current=0,_.current="none",T.current=!1,$.current=!1,R.current=0,I.current=null,X.current=null,L.current=!1,Ce.current=n,Se.current=g==null?void 0:g.assetId)},[n,g==null?void 0:g.assetId,z]),s.useLayoutEffect(()=>{const He=U.current;He!==null&&(U.current=null,requestAnimationFrame(()=>{E.current(He)}))},[n,g==null?void 0:g.assetId]),s.useEffect(()=>{if(k!=="open")return;let He=null;const Ae=()=>{He&&(document.removeEventListener("click",He,!0),He=null)},Be=()=>{Ae(),He=rt=>{rt.stopPropagation(),rt.preventDefault(),Ae()},document.addEventListener("click",He,!0)},Ie=rt=>{const St=rt<0?1:-1;if(Math.abs(rt)>Yy&&t.length>1){ee(St,!0);return}ee(St,!1)},mt=rt=>{if(rt.touches.length!==1||$.current)return;const St=rt.touches[0];L.current=!0,X.current={x:St.clientX,y:St.clientY},_.current="none",N.current=0,T.current=!1},ot=rt=>{if(!X.current||rt.touches.length!==1||$.current)return;const St=rt.touches[0],nt=St.clientX-X.current.x,Rt=St.clientY-X.current.y;if(_.current==="none"){if(Math.abs(nt)<10&&Math.abs(Rt)<10)return;if(Math.abs(nt)>Math.abs(Rt)){if(t.length<=1)return;_.current="horizontal"}else if(Rt>0)_.current="vertical";else return}if(_.current==="horizontal"){T.current=!0,oe(!0),N.current=nt;const ht=nt<0?1:-1;I.current!==ht&&(I.current=ht,de(ht)),R.current=nt,fe(nt),rt.preventDefault();return}_.current==="vertical"&&(T.current=!0,oe(!0),j.current=Rt,ue(Rt),rt.preventDefault())},Ct=()=>{if(!X.current)return;const rt=_.current,St=T.current;if(St&&rt==="horizontal")Ie(N.current),Be();else if(St&&rt==="vertical")if(j.current>Ky){const Rt=window.innerHeight;j.current=Rt,ve(!0),ue(Rt),me("closing")}else j.current=0,ue(0),Be();else rt==="horizontal"&&Math.abs(N.current)>0&&(Ie(N.current),Be());X.current=null,_.current="none",N.current=0,T.current=!1,oe(!1)};return document.addEventListener("touchstart",mt,{passive:!0}),document.addEventListener("touchmove",ot,{passive:!1}),document.addEventListener("touchend",Ct),document.addEventListener("touchcancel",Ct),()=>{document.removeEventListener("touchstart",mt),document.removeEventListener("touchmove",ot),document.removeEventListener("touchend",Ct),document.removeEventListener("touchcancel",Ct),Ae()}},[k,t.length,ee]),s.useEffect(()=>{const He=Ae=>{Ae.key==="Escape"&&(Ae.preventDefault(),Ae.stopPropagation(),k!=="closing"&&me("closing"))};return window.addEventListener("keydown",He,!0),()=>window.removeEventListener("keydown",He,!0)},[k]);const W=()=>{k!=="closing"&&me("closing")},ke=k==="open",ze=k==="closing",Xe=C>0?Math.max(0,1-C/500):1,Ue=C>0?Math.max(.35,1-C/500):1,Qe=J&&g?{width:b.getEmbedAspect(g),height:1}:Fe,We=f?v?f:iv(f,Qe):null,it={position:"fixed",top:q==null?void 0:q.top,left:q==null?void 0:q.left,width:q==null?void 0:q.width,height:q==null?void 0:q.height,zIndex:9998},ye=v?"cover":"contain",Te=te!==0||C>0?`translate(${te}px, ${C}px)`:void 0,Ve=ie&&!we?"none":we?`transform ${Nn}ms ${hi}`:le?`transform ${Nn}ms ${hi}, opacity ${Nn}ms ${hi}`:k==="opening"||ze?`opacity ${Nn}ms ${hi}`:"none",Ze={...it,transform:Te,opacity:C>0?Ue:k==="opening"||ze?0:1,transition:Ve,pointerEvents:"none"},et={position:"absolute",top:((We==null?void 0:We.top)??0)-((q==null?void 0:q.top)??0),left:((We==null?void 0:We.left)??0)-((q==null?void 0:q.left)??0),width:We==null?void 0:We.width,height:We==null?void 0:We.height,objectFit:ye,pointerEvents:"none"},at=(q==null?void 0:q.width)??0,tt=re?(n+Pe+t.length)%t.length:null,Ye=tt!==null?t[tt]:null,xt={...it,transform:re?`translateX(${Pe*at+te}px)`:void 0,opacity:1,transition:we?`transform ${Nn}ms ${hi}`:"none",pointerEvents:"none"},pt={position:"absolute",top:((f==null?void 0:f.top)??0)-((q==null?void 0:q.top)??0),left:((f==null?void 0:f.left)??0)-((q==null?void 0:q.left)??0),width:f==null?void 0:f.width,height:f==null?void 0:f.height,objectFit:ye,pointerEvents:"none"},De=J&&g&&b.getEmbedPlayback(g).controls&&We?Math.min(52,We.height*.2):0,_e=We?{position:"fixed",top:We.top,height:We.height-De,width:We.width/2,zIndex:9999}:null;return a.jsxs("div",{ref:P,className:[`${e}-lightbox`,o?`${e}-lightbox-editor`:""].filter(Boolean).join(" "),style:{touchAction:k==="open"?"none":void 0},onClick:W,children:[a.jsx("div",{style:{position:"absolute",inset:0,background:"rgba(28,31,34,0.9)",opacity:ke?Xe:0,transition:ie?"none":`opacity ${Nn}ms ${hi}`,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:M,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:ke?1:0,transition:`opacity ${Nn}ms ${hi}`,pointerEvents:"none",zIndex:9999},children:t.length>1&&a.jsxs("p",{className:p,style:y,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:M,style:{width:"100%",height:"100%"}})}),a.jsx("div",{style:{display:"flex",flexDirection:"row",justifyContent:"center",alignItems:"center",height:"10%",opacity:ke?1:0,transition:`opacity ${Nn}ms ${hi}`},children:t.length>1&&a.jsxs("p",{className:p,style:y,children:[n+1," / ",t.length]})})]})}),f&&q&&Ye&&a.jsx("div",{style:xt,onTransitionEnd:be,children:b.isEmbedMedia(Ye)?a.jsx("img",{src:Ye.thumbnail,alt:Ye.name,style:pt},`neighbor-${tt}-${Ye.assetId}`):Ki(Ye)?a.jsx("video",{src:Ye.assetId,muted:!0,autoPlay:!0,loop:!0,playsInline:!0,preload:"auto",style:pt},`neighbor-${tt}-${Ye.assetId}`):a.jsx("img",{src:Ye.assetId,alt:Ye.name,style:pt},`neighbor-${tt}-${Ye.assetId}`)}),f&&q&&g&&a.jsx("div",{style:Ze,onTransitionEnd:be,children:J?a.jsx(b.EmbedMediaFrame,{media:g,fit:v?"cover":"contain",lazy:!1,startsAtOnce:!0,style:et},`${n}-${g.assetId}`):Z?a.jsx(ov,{src:g.assetId,mediaRef:K,mediaStyle:et,onLoadedMetadata:he},`${n}-${g.assetId}`):a.jsx("img",{ref:K,src:g.assetId,alt:g.name,onLoad:he,style:et},`${n}-${g.assetId}`)}),ke&&_e&&t.length>1&&a.jsxs(a.Fragment,{children:[a.jsx("div",{style:{..._e,left:We.left,cursor:"w-resize",pointerEvents:ie?"none":"auto"},onClick:He=>{if(L.current){L.current=!1;return}He.stopPropagation(),H(-1)}}),a.jsx("div",{style:{..._e,left:We.left+We.width/2,cursor:"e-resize",pointerEvents:ie?"none":"auto"},onClick:He=>{if(L.current){L.current=!1;return}He.stopPropagation(),H(1)}})]}),a.jsx(sv,{prefix:e,closeIcon:S,closeIconMaxWidth:m,closeIconColor:h,closeIconHoverColor:x,iconMarginRight:w,contentMarginTop:F,isEditor:o,isPreviewMode:r,isEditMode:l,visible:ke,onClose:W})]})}function cv(e){return typeof e=="string"?e==="cover"?"cover":"fit":(e==null?void 0:e.display)==="cover"?"cover":"fit"}function dv({settings:e,content:t,isEditor:n,isPreviewMode:i,isEditMode:o,metadata:r,activeEvent:l,layoutId:c,portalId:d}){const{prefix:u}=b.useScopedStyles(),{type:p="a",gridLayout:y,textBoxWidth:S=100,verticalGap:m,entriesCount:h,lightbox:x,imageDisplay:w,imageCorners:F,lightboxImageDisplay:v,slider:P,sliderTiming:M,direction:K,transition:X,titleMarginTop:j,subtitleMarginTop:N,titleColor:_,subtitleColor:T,lightboxCounterColor:L,titleFontFamily:Y,titleFontSettings:R,titleFontSize:I,titleLineHeight:$,titleLetterSpacing:G,titleWordSpacing:O,titleTextAppearance:U,subtitleFontFamily:E,subtitleFontSettings:f,subtitleFontSize:Q,subtitleLineHeight:q,subtitleLetterSpacing:pe,subtitleWordSpacing:k,subtitleTextAppearance:me,lightboxCounterFontFamily:C,lightboxCounterFontSettings:ue,lightboxCounterFontSize:te,lightboxCounterLineHeight:fe,lightboxCounterLetterSpacing:Pe,lightboxCounterWordSpacing:de,lightboxCounterTextAppearance:we,closeIcon:V,closeIconMaxWidth:ie,closeIconColor:oe,closeIconHoverColor:le,iconMarginRight:ve,contentMarginTop:Fe,showText:Ee="always",alignEntries:Ce="off",align:Se="top"}=e,g={fontSettings:{fontFamily:Y,fontWeight:(R==null?void 0:R.fontWeight)??400,fontStyle:(R==null?void 0:R.fontStyle)??"normal"},fontSize:I??.01,lineHeight:$,letterSpacing:G??0,wordSpacing:O??0,textAppearance:U,color:_},J={...pn(nn(g,n))},re={fontSettings:{fontFamily:E,fontWeight:(f==null?void 0:f.fontWeight)??400,fontStyle:(f==null?void 0:f.fontStyle)??"normal"},fontSize:Q??.01,lineHeight:q,letterSpacing:pe??0,wordSpacing:k??0,textAppearance:me,color:T},z={...pn(nn(re,n))},B={fontSettings:{fontFamily:C,fontWeight:(ue==null?void 0:ue.fontWeight)??400,fontStyle:(ue==null?void 0:ue.fontStyle)??"normal"},fontSize:te??.01,lineHeight:fe,letterSpacing:Pe??0,wordSpacing:de??0,textAppearance:we,color:L},ce={...pn(nn(B,n)),...rs(te,fe,u,n)},ee=os(I,$,`${u}-item-title`,`${u}-text-tight-leading`),H=os(Q,q,`${u}-item-subtitle`,`${u}-text-tight-leading`),be=rs(I,$,u,n),ae=rs(Q,q,u,n),W=os(te,fe,`${u}-lightbox-counter`,`${u}-text-tight-leading`),ke=b.buildColorVars(u,{titleColor:_,subtitleColor:T,lightboxCounterColor:L},uv,pv),Ue=`${l&&l!=="default"?`${u}-state-${l}`:""}${Ee==="on hover"&&(!n||i)?` ${u}-show-text-hover`:""}`.trim(),Qe=h===0?1/0:h,We=(t??[]).slice(0,Qe),it=s.useMemo(()=>x==="on"?ev(We):[],[We,x]),ye=y.entryWidth??.2,Te=(w==null?void 0:w.display)==="cover",Ve=(w==null?void 0:w.ratioValue)??"1:1",Ze=(w==null?void 0:w.reversed)??!1,[et,at]=Ve.split(":").map(Number),xt=`${Ze?at:et} / ${Ze?et:at}`,pt=y.columnsCount,De=b.scalingValue(ye??0,n),_e=De,He=!Te&&P!=="off",Ae=We.length%pt||pt,Be=Ae<pt&&We.length>0,Ie=We.length-Ae,mt=Be?Math.floor((pt-Ae)/2)+1:1,ot=F?b.scalingValue(F,n):void 0,Ct={width:_e,...Te?{aspectRatio:xt,height:"auto",overflow:"hidden"}:{height:"auto"},...ot?{borderRadius:ot,overflow:"hidden"}:{}},rt=`${u}-item-image-wrapper${He?` ${u}-item-image-wrapper-fit-slider`:""}`.trim(),St=p==="d"||p==="e"||p==="f",nt=Ce==="on",Rt=`calc(${b.scalingValue(ye??0,n)} * (${S} / 100))`,ht=b.scalingValue(ye*S/100,n),Vt=Te?{objectFit:"cover",pointerEvents:"auto",width:"100%",height:"100%",maxWidth:"100%",...ot?{borderRadius:ot}:{}}:{objectFit:"contain",pointerEvents:"auto",width:"auto",height:"auto",maxWidth:"100%",...ot?{borderRadius:ot}:{}},[Zt,$e]=s.useState(0),Ge=s.useRef(null),ft=X==="fade"||K==="horizontal"?"ltr":K==="vertical"?"ttb":"ltr";s.useEffect(()=>{const Ke=Ge.current;if(!Ke)return;const st=new ResizeObserver(It=>{$e(Math.round(It[0].contentRect.width))});return st.observe(Ke),()=>st.disconnect()},[]);const Lt=(()=>{const Ke={...ke},st=Ge.current?getComputedStyle(Ge.current).getPropertyValue("--cntrl-article-width").trim():"";return st&&(Ke["--cntrl-article-width"]=st),Ke})(),[wt,vt]=s.useState(!1),[Nt,Wt]=s.useState([]),[Dt,Me]=s.useState(0),ct=x==="on"&&(!n||i),dt=(Ke,st)=>{n&&!i||x!=="off"&&(Wt(Ke),Me(st),vt(!0))};s.useEffect(()=>{if(!wt||x!=="on"||typeof document>"u")return;const Ke=document.body.style.overflow;return document.body.style.overflow="hidden",()=>{document.body.style.overflow=Ke}},[wt,x]),s.useEffect(()=>{!n||i||vt(!1)},[n,i]);const kt=s.useMemo(()=>Vy(u),[u]);return a.jsxs(a.Fragment,{children:[a.jsx("style",{dangerouslySetInnerHTML:{__html:kt}}),x==="on"&&a.jsx(tv,{mediaList:it}),a.jsx("div",{style:ke,children:a.jsx("div",{ref:Ge,className:`${u}-wrapper ${u}-type-${p}${nt?` ${u}-align-entries`:""} ${u}-image-align-${Se} ${Ue}`.trim(),style:{gridTemplateColumns:`repeat(${pt}, ${De})`,rowGap:nt?0:b.scalingValue(m??0,n),columnGap:b.scalingValue(y.horizontalGap??0,n),width:b.scalingValue(y.wrapperWidth??0,n),...nt?{[`--${u}-align-entries-row-gap`]:b.scalingValue(m??0,n)}:{}},children:We.map((Ke,st)=>{var yt;const It=Pc(Ke.title),At=Pc(Ke.subtitle),ut=x==="off"&&((yt=Ke.link)!=null&&yt.value)?Ke.link:void 0,Gt=Math.floor(st/pt)===Math.ceil(We.length/pt)-1,Ut=Be&&st>=Ie?`${mt+(st-Ie)}`:void 0,Ot=St?a.jsxs("div",{className:`${u}-item-text-block`,children:[It&&a.jsx("p",{className:ee,style:{width:Rt,...J,...be},children:Ke.title}),It&&a.jsx("div",{"data-controls":o?"titleMarginTop":void 0,className:o?`${u}-control`:void 0,style:{height:b.scalingValue(j??0,n),width:ht}}),At&&a.jsx("p",{className:H,style:{width:Rt,...z,...ae},children:Ke.subtitle}),At&&a.jsx("div",{"data-controls":o?"subtitleMarginTop":void 0,className:o?`${u}-control`:void 0,style:{height:b.scalingValue(N??0,n),width:ht}})]}):null,Bt=nt?a.jsxs("div",{className:`${u}-item-title-row`,children:[!St&&a.jsx("div",{"data-controls":o&&It?"titleMarginTop":void 0,className:o&&It?`${u}-control`:void 0,style:{height:It?b.scalingValue(j??0,n):0,width:ht}}),It&&a.jsx("p",{className:ee,style:{width:Rt,...J,...be},children:Ke.title}),St&&It&&a.jsx("div",{"data-controls":o?"titleMarginTop":void 0,className:o?`${u}-control`:void 0,style:{height:b.scalingValue(j??0,n),width:ht}})]}):null,Xt=nt?a.jsxs("div",{className:`${u}-item-subtitle-row`,children:[!St&&a.jsx("div",{"data-controls":o&&At?"subtitleMarginTop":void 0,className:o&&At?`${u}-control`:void 0,style:{height:At?b.scalingValue(N??0,n):0,width:ht}}),At&&a.jsx("p",{className:H,style:{width:Rt,...z,...ae},children:Ke.subtitle}),St&&At&&a.jsx("div",{"data-controls":o?"subtitleMarginTop":void 0,className:o?`${u}-control`:void 0,style:{height:b.scalingValue(N??0,n),width:ht}})]}):null,zt=a.jsxs(b.LinkWrapper,{link:ut,className:`${u}-item-text-link`,children:[Bt,Xt]}),Kt=np(Ke.gallery),D=Kt.filter(Tt=>Tt.lightboxMedia).map(Tt=>Tt.lightboxMedia),Le=a.jsx("div",{className:rt,style:Ct,children:Kt.length===0?null:P==="off"?(()=>{const{displayMedia:Tt,lightboxMedia:Je}=Kt[0],Pt=Je?D.findIndex($t=>$t.assetId===Je.assetId):-1;return a.jsx(Mc,{media:Tt,className:`${u}-item-${Ki(Tt)?"video":"image"}`.trim(),style:Vt,hasLightbox:x==="on",onMediaClick:ct&&Pt>=0?()=>dt(D,Pt):void 0})})():a.jsxs(a.Fragment,{children:[He&&a.jsx("div",{className:`${u}-item-image-wrapper-sizer`,"aria-hidden":"true",children:Kt.map(({displayMedia:Tt})=>b.isEmbedMedia(Tt)?a.jsx("div",{style:{aspectRatio:`${b.getEmbedAspect(Tt)}`}},`sizer-${Tt.assetId}`):Ki(Tt)?a.jsx("video",{src:Tt.assetId,muted:!0,playsInline:!0},`sizer-${Tt.assetId}`):a.jsx("img",{src:Tt.assetId,alt:""},`sizer-${Tt.assetId}`))}),a.jsx(kl,{className:`${u}-item-slider`,options:{arrows:!1,pagination:!1,drag:!1,perPage:1,autoplay:!0,interval:M*1e3,width:"100%",height:"100%",speed:qy,type:X==="fade"?"fade":"loop",rewind:X==="fade",pauseOnHover:!1,pauseOnFocus:!1,direction:ft},onMoved:Tt=>{K!=="random"||X==="fade"||Uy(Tt)},children:Kt.map(({displayMedia:Tt,lightboxMedia:Je},Pt)=>{const $t=Je?D.findIndex(_t=>_t.assetId===Je.assetId):-1;return a.jsx(Al,{children:a.jsx(Mc,{media:Tt,className:`${u}-item-${Ki(Tt)?"video":"image"}`.trim(),style:Vt,hasLightbox:x==="on",onMediaClick:ct&&$t>=0?()=>dt(D,$t):void 0})},Pt)})},`${X}-${ye}-${K}-${M}-${Zt}-${c}`)]})}),Ne=St?null:a.jsxs(a.Fragment,{children:[a.jsx("div",{"data-controls":o&&It?"titleMarginTop":void 0,className:o&&It?`${u}-control`:void 0,style:{height:It?b.scalingValue(j??0,n):0,width:ht}}),a.jsx("p",{className:ee,style:{width:Rt,...J,...be},children:Ke.title}),a.jsx("div",{"data-controls":o&&At?"subtitleMarginTop":void 0,className:o&&At?`${u}-control`:void 0,style:{height:At?b.scalingValue(N??0,n):0,width:ht}}),a.jsx("p",{className:H,style:{width:Rt,...z,...ae},children:Ke.subtitle})]}),Oe=ut?a.jsx(b.LinkWrapper,{link:ut,className:`${u}-item-image-link`,children:Le}):a.jsx("a",{className:`${u}-item-image-link`,children:Le});return a.jsx("div",{className:`${u}-item`.trim(),style:Ut&&!nt?{gridColumn:Ut}:void 0,children:a.jsx("div",{className:`${o?`${u}-item-inner`:`${u}-item-inner-hidden`}${nt&&Gt?` ${u}-item-inner-last-row`:""}`.trim(),style:{width:(S??0)>100?`calc(${De} * (${S} / 100))`:De,...Ut&&nt?{gridColumn:Ut}:{}},children:nt?a.jsx(a.Fragment,{children:St?a.jsxs(a.Fragment,{children:[zt,Oe]}):a.jsxs(a.Fragment,{children:[Oe,zt]})}):ut?a.jsxs(a.Fragment,{children:[a.jsxs(b.LinkWrapper,{link:ut,className:`${u}-item-image-link`,children:[Ot,Le]}),!St&&a.jsx(b.LinkWrapper,{link:ut,className:`${u}-item-text-link`,children:Ne})]}):a.jsxs(a.Fragment,{children:[Ot,Le,Ne]})})},st)})})}),(!n||i)&&wt&&typeof document<"u"&&x==="on"&&(()=>{const Ke=(d?document.getElementById(d):null)??document.body;return qn.createPortal(a.jsx("div",{style:Lt,"data-selection":"none",children:a.jsx(lv,{prefix:u,items:Nt,index:Dt,imageDisplay:cv(v),isEditor:n,isPreviewMode:i,isEditMode:o,closeIcon:V,closeIconMaxWidth:ie,closeIconColor:oe,closeIconHoverColor:le,iconMarginRight:ve,contentMarginTop:Fe,onClose:()=>vt(!1),onPrev:()=>Me(st=>(st-1+Nt.length)%Nt.length),onNext:()=>Me(st=>(st+1)%Nt.length),counterClassName:W,counterStyle:ce})}),Ke)})()]})}const uv={titleColor:"title-color",subtitleColor:"subtitle-color",lightboxCounterColor:"lightbox-counter-color"},pv=["hover","focus","filled","success","error"],mv=`import { Splide, SplideSlide } from '@splidejs/react-splide';
|
|
5305
5305
|
import '@splidejs/react-splide/css/core';
|
|
5306
5306
|
import { CommonComponentProps } from '../props';
|
|
5307
5307
|
import { EmbedMediaFrame, getEmbedAspect, getEmbedPlayback, isEmbedMedia } from '../utils/index';
|
|
@@ -7898,7 +7898,7 @@ const STATE_KEYS = ['hover', 'focus', 'filled', 'success', 'error'] as const;
|
|
|
7898
7898
|
pointer-events: auto;
|
|
7899
7899
|
flex-shrink: 0;
|
|
7900
7900
|
}
|
|
7901
|
-
`}const _c={assetId:"",name:"",objectFit:"cover"},On=500,qo=650,Cn="cubic-bezier(0.22, 1, 0.36, 1)",kv=72,Av=50,Fv=1e4,Nv=650,_v=500;function Hv(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 cp(e,t){if(t==="contain"&&e instanceof HTMLImageElement){const i=wa(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 Wv(e,t,n){const i=e.querySelector(`[data-hive-grid-index="${t}"]`);return i instanceof HTMLElement?cp(i,n):null}function Ov(e){return e.reduce((t,n,i)=>{const o=Wl(n.gallery),l=Ol(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 ir(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 Hc(e,t,n){if(e.length<=2)return null;const i=(t+n+e.length)%e.length;return ir(e,i,n)}const Dv=.03;function dp(e){return e.width*Dv}const ls={left:0,top:0,width:typeof window<"u"?window.innerWidth:1440,height:typeof window<"u"?window.innerHeight:900};function Br(e,t){return{left:e.left-t.left,top:e.top-t.top,width:e.width,height:e.height}}function Wc(e){const t=e.getBoundingClientRect();return{width:t.width,height:t.height,left:t.left,top:t.top}}function zv(e){return e instanceof HTMLVideoElement?{width:e.videoWidth,height:e.videoHeight}:{width:e.naturalWidth,height:e.naturalHeight}}function Xs(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 Bv(e,t){return!e||!(t!=null&&t.width)||!(t!=null&&t.height)?null:Xs(e,t.width,t.height)}function jv(e,t){if(b.isEmbedMedia(e)){t(e.assetId,b.getEmbedAspect(e),1);return}if(Bo(e)){const i=document.createElement("video"),o=()=>{i.videoWidth>0&&i.videoHeight>0&&t(e.assetId,i.videoWidth,i.videoHeight),i.removeEventListener("loadedmetadata",o)};i.addEventListener("loadedmetadata",o),i.preload="auto",i.src=e.assetId,i.load();return}const n=new Image;n.onload=()=>{n.naturalWidth>0&&n.naturalHeight>0&&t(e.assetId,n.naturalWidth,n.naturalHeight)},n.src=e.assetId}function Vv(e){const t=new Set,n=[];for(const i of e){const o=Wl(i.gallery),r=Ol(o);for(const l of r)for(const c of[l.displayMedia,l.lightboxMedia])c!=null&&c.assetId&&!t.has(c.assetId)&&(t.add(c.assetId),n.push(c))}return n}function Gv({mediaList:e}){const t=e.filter(n=>!b.isEmbedMedia(n));return t.length===0?null:a.jsx("div",{"aria-hidden":!0,style:{position:"absolute",width:0,height:0,overflow:"hidden",opacity:0,pointerEvents:"none"},children:t.map(n=>Bo(n)?a.jsx("video",{src:n.assetId,preload:"auto",muted:!0,playsInline:!0},n.assetId):a.jsx("img",{src:n.assetId,alt:""},n.assetId))})}function Mo(e,t,n){const{width:i,height:o,top:r}=e,{left:l,width:c}=n,d=dp(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 $a(e,t,n){const i=Mo(e,t,n);return{...i,left:2*i.left-e.left}}function Xv(e,t,n){const{left:i,width:o}=n,r=dp(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 up(e,t,n,i){const o=Mo(e,"left",i),r=Mo(e,"right",i),l=$a(e,"left",i),c=$a(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 Uv(e,t,n,i){const{start:o,end:r}=up(e,t,n,i);return{x:r.left-o.left,y:r.top-o.top}}function qv(e,t,n){const i=Mo(e,t,n),o=$a(e,t,n);return{x:o.left-i.left,y:o.top-i.top}}function pp(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 Wl(e){if(!e)return;if(pp(e))return e;if(!Array.isArray(e))return;const[t,n]=e,i=t!=null&&t.assetId?t:void 0,o=n!=null&&n.assetId?n:void 0;if(!(!i&&!o))return[{media:[o??i??_c,i??o??_c]}]}function Kv(e){const[t,n]=e.media;return n!=null&&n.assetId?n:t!=null&&t.assetId?t:null}function Yv(e){const[t]=e.media;return t!=null&&t.assetId?t:null}function Ol(e){if(!Array.isArray(e)||e.length===0)return[];if(pp(e)){const t=[];for(const n of e){const i=Kv(n);if(!i)continue;const o=Yv(n);t.push({displayMedia:i,lightboxMedia:o!=null&&o.assetId?o:null})}return t}return e.filter(t=>t==null?void 0:t.assetId).map(t=>({displayMedia:t,lightboxMedia:t}))}function Bo(e){return b.isEmbedMedia(e)?!1:e.type==="video"?!0:/\.(mp4|webm|ogg|mov)(\?|#|$)/i.test(e.assetId)}function Qv({media:e,className:t,style:n,gridIndex:i,onMediaClick:o}){return b.isEmbedMedia(e)?a.jsx(b.EmbedMediaFrame,{media:e,fit:n.objectFit==="contain"?"contain":"cover",silentLoop:!0,className:t,"data-hive-grid-index":i,style:{...n,cursor:o?"pointer":"default"},onClick:o}):Bo(e)?a.jsx("video",{src:e.assetId,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.assetId,alt:e.name,className:t,"data-hive-grid-index":i,style:{...n,cursor:o?"pointer":"default"},onClick:o})}function Zv({src:e,onMediaElement:t,wrapperStyle:n,videoStyle:i,onLoadedMetadata:o,onTransitionEnd:r}){const l=s.useRef(null);return s.useEffect(()=>{const c=l.current;return t==null||t(c??null),()=>{c==null||c.pause(),t==null||t(null)}},[e,t]),a.jsx("div",{style:n,onTransitionEnd:r,children:a.jsx("video",{ref:l,src:e,muted:!0,autoPlay:!0,loop:!0,playsInline:!0,preload:"auto",onLoadedMetadata:o,style:i},e)})}function jr({media:e,style:t,onTransitionEnd:n,onMeasure:i}){return b.isEmbedMedia(e)?a.jsx("img",{src:e.thumbnail,alt:e.name,style:t,onTransitionEnd:n}):Bo(e)?a.jsx("video",{src:e.assetId,muted:!0,autoPlay:!0,loop:!0,playsInline:!0,preload:"auto",style:t,onLoadedMetadata:o=>{const r=o.currentTarget;r.videoWidth>0&&r.videoHeight>0&&(i==null||i(e.assetId,r.videoWidth,r.videoHeight))},onTransitionEnd:n}):a.jsx("img",{src:e.assetId,alt:e.name,style:t,onLoad:o=>{const r=o.currentTarget;r.naturalWidth>0&&r.naturalHeight>0&&(i==null||i(e.assetId,r.naturalWidth,r.naturalHeight))},onTransitionEnd:n})}function Jv({prefix:e,items:t,index:n,entry:i,settings:o,isEditor:r,isEditMode:l,isPreviewMode:c,canNavigate:d,lightboxEntries:u,entryIdx:p,layoutId:y,sourceRect:S,resolveCloseSourceRect:m,onClose:h,onPrev:x,onNext:w}){const F=s.useRef(null),v=s.useRef(null),P=s.useRef(null),M=s.useRef(new Map),[K,X]=s.useState(0),j=s.useRef(null),N=s.useRef(0),_=s.useRef(0),T=s.useRef("none"),L=s.useRef(!1),Y=s.useRef(!1),R=s.useRef(!1),I=s.useRef(null),$=s.useRef(null),G=s.useRef(null),O=s.useRef(()=>{}),U=s.useRef(null),E=s.useRef(null),f=s.useRef(null),Q=s.useRef(!1),[q,pe]=s.useState(null),[k,me]=s.useState(ls),[C,ue]=s.useState(0),[te,fe]=s.useState("opening"),[Pe,de]=s.useState(0),[we,V]=s.useState(0),[ie,oe]=s.useState(!1),[le,ve]=s.useState(null),[Fe,Ee]=s.useState(null),[Ce,Se]=s.useState(null),[g,Z]=s.useState(!1),[J,re]=s.useState(null),[he,z]=s.useState(!1),B=s.useRef(!1),[ne,ce]=s.useState(!1),[ee,H]=s.useState(!1),be=s.useRef(n),ae=s.useRef(void 0),W=t[n],ke=W?Bo(W):!1,ze=W?b.isEmbedMedia(W):!1,Xe=we!==0||ie,Ue=!l&&(!r||!!c),Qe=d&&!l,We=u.length>1,it=s.useCallback((D,Le)=>t.length<=1?null:t[(D+Le+t.length)%t.length]??null,[t]),ye=We?ir(u,p,-1):it(n,-1),Te=We?ir(u,p,1):it(n,1),Ve=le===-1&&Xe?We&&Fe!==null?ir(u,Fe,-1):Ce!==null?it(Ce,-1):null:null,Ze=le===1&&Xe?We&&Fe!==null?ir(u,Fe,1):Ce!==null?it(Ce,1):null:null,et=Ve&&Ve.assetId!==(ye==null?void 0:ye.assetId)?Ve:null,at=Ze&&Ze.assetId!==(Te==null?void 0:Te.assetId)?Ze:null,tt=ye&&Qe?(()=>{const D=We?Hc(u,p,-1):t.length>2?it((n-1+t.length)%t.length,-1):null;return D&&D.assetId!==ye.assetId?D:null})():null,Ye=Te&&Qe?(()=>{const D=We?Hc(u,p,1):t.length>2?it((n+1)%t.length,1):null;return D&&D.assetId!==Te.assetId?D:null})():null,xt=et??tt,pt=at??Ye,De=s.useCallback((D,Le,Ne)=>{if(!D||!Le||!Ne)return;const Oe=M.current,yt=Oe.get(D);(yt==null?void 0:yt.width)===Le&&(yt==null?void 0:yt.height)===Ne||(Oe.set(D,{width:Le,height:Ne}),X(Tt=>Tt+1))},[]),_e=s.useCallback(D=>{if(!(D!=null&&D.assetId))return null;const Le=M.current.get(D.assetId);return Bv(v.current,Le)},[K,C]),He=s.useCallback(()=>{if(!W)return;const D=_e(W);if(D){pe(D);return}const Le=v.current;Le&&pe(Wc(Le))},[W,_e]),Ae=s.useCallback(D=>{if(We){const Le=u.length;Ee((p+D+Le)%Le),Se(null);return}t.length>1&&(Se((n+D+t.length)%t.length),Ee(null))},[We,u.length,p,t.length,n]),Be=s.useCallback(D=>{R.current=D,oe(D)},[]),Ie=s.useCallback(()=>{I.current!==null&&(window.clearTimeout(I.current),I.current=null)},[]),mt=s.useCallback(()=>{Ie(),I.current=window.setTimeout(()=>{Ie(),Be(!1)},qo+32)},[Ie,Be]),ot=s.useCallback(()=>{const D=F.current;if(!D){me({left:0,top:0,width:typeof window<"u"?window.innerWidth:ls.width,height:typeof window<"u"?window.innerHeight:ls.height});return}const Le=D.getBoundingClientRect();me({left:Le.left,top:Le.top,width:Le.width,height:Le.height})},[]),Ct=s.useCallback((D,Le)=>{if(Xe){if(ne&&!ie)return`translate(${we}px, 0px)`;if(ie&&le!==null){const Ne=_e(D);if(!Ne)return;const{x:Oe,y:yt}=Uv(Ne,Le,le,k);return`translate(${Oe}px, ${yt}px)`}if(ie)return"translate(0px, 0px)"}},[Xe,ne,ie,we,le,k,_e]),rt=s.useCallback(()=>{const D=$.current;$.current=null,Ie(),Be(!1),ve(null),Ee(null),Se(null),V(0),ce(!1),L.current=!1,_.current=0,T.current="none",D===-1?x():D===1&&w()},[Ie,Be,x,w]),St=s.useCallback(()=>{Ie(),I.current=window.setTimeout(()=>{$.current!==null&&rt()},qo+32)},[Ie,rt]),nt=s.useCallback(()=>{Ie(),$.current=null,Be(!1),ve(null),Ee(null),Se(null),V(0),ce(!1),L.current=!1,_.current=0,T.current="none"},[Ie,Be]),Rt=s.useCallback(D=>{if(!(!Qe||!q)){if(R.current){if($.current===D){G.current=D,rt();return}nt()}Ie(),Ae(D),$.current=D,ve(D),Be(!0),St()}},[Qe,q,rt,nt,Ie,Ae,Be,St]);O.current=Rt;const ht=s.useCallback(()=>{U.current=null,Q.current=!1,E.current!==null&&(window.clearInterval(E.current),E.current=null),f.current!==null&&(window.clearTimeout(f.current),f.current=null)},[]),Gt=s.useCallback(D=>{E.current!==null&&window.clearInterval(E.current);const Le=Q.current?_v:Nv;E.current=window.setInterval(()=>{O.current(D)},Le)},[]),Zt=s.useCallback(D=>{U.current!==D&&(ht(),U.current=D,Q.current=!1,O.current(D),Gt(D),f.current=window.setTimeout(()=>{f.current=null,U.current===D&&(Q.current=!0,Gt(D))},Fv))},[ht,Gt]),$e=s.useCallback(()=>{const D=v.current;if(!D)return;const Le=W==null?void 0:W.assetId,Ne=Le?M.current.get(Le):void 0;if(Ne!=null&&Ne.width&&(Ne!=null&&Ne.height)){pe(Xs(D,Ne.width,Ne.height));return}const Oe=P.current;if(Oe&&Le&&(Oe.src===Le||Oe.currentSrc===Le)){const{width:Tt,height:Je}=zv(Oe);if(Tt&&Je){De(Le,Tt,Je),pe(Xs(D,Tt,Je));return}}const yt=Wc(D);!yt.width||!yt.height||pe(yt)},[W==null?void 0:W.assetId,De]),Ge=s.useCallback(D=>{if(P.current=D,!!D){if(D instanceof HTMLVideoElement){D.readyState>=1&&D.videoWidth>0&&$e();return}D.complete&&D.naturalWidth>0&&$e()}},[$e]),ft=s.useCallback(()=>{ot(),$e(),ue(D=>D+1)},[ot,$e]);s.useEffect(()=>{ft();const D=v.current,Le=F.current,Ne=new ResizeObserver(()=>ft());return D&&Ne.observe(D),Le&&Ne.observe(Le),window.addEventListener("resize",ft),()=>{Ne.disconnect(),window.removeEventListener("resize",ft)}},[ft,n,y]),s.useLayoutEffect(()=>{if(!W)return;const D=P.current;if(D){if(D instanceof HTMLImageElement&&D.complete&&D.naturalWidth>0){$e();return}D instanceof HTMLVideoElement&&D.readyState>=1&&D.videoWidth>0&&$e()}},[W==null?void 0:W.assetId,n,$e]),s.useEffect(()=>{He()},[He,K]),s.useEffect(()=>{const D=new Set,Le=[],Ne=Oe=>{!(Oe!=null&&Oe.assetId)||D.has(Oe.assetId)||(D.add(Oe.assetId),Le.push(Oe))};t.forEach(Ne),u.forEach(Oe=>Oe.items.forEach(Ne)),Le.forEach(Oe=>{M.current.has(Oe.assetId)||jv(Oe,De)})},[t,u,De]),s.useEffect(()=>{if(te!=="opening"||!q)return;if(!S){fe("open");return}Z(!1);const D=requestAnimationFrame(()=>{requestAnimationFrame(()=>{Z(!0),fe("open")})});return()=>cancelAnimationFrame(D)},[te,q,S]),s.useEffect(()=>{if(te!=="closing")return;const D=setTimeout(()=>h(),On);return()=>clearTimeout(D)},[te,h]),s.useEffect(()=>()=>{Ie()},[Ie]),s.useLayoutEffect(()=>{be.current===n&&ae.current===(W==null?void 0:W.assetId)||(Ie(),$.current=null,ve(null),Ee(null),Se(null),de(0),V(0),Be(!1),H(!1),ce(!1),N.current=0,_.current=0,T.current="none",L.current=!1,j.current=null,Y.current=!1,P.current=null,He(),be.current=n,ae.current=W==null?void 0:W.assetId)},[n,W==null?void 0:W.assetId,Be,Ie,He]),s.useLayoutEffect(()=>{const D=G.current;D!==null&&(G.current=null,requestAnimationFrame(()=>{O.current(D)}))},[n,p,W==null?void 0:W.assetId]),s.useLayoutEffect(()=>{if(te==="opening"){B.current=!1,z(!1);return}if(te!=="open"||B.current)return;if(!ye&&!Te){B.current=!0;return}z(!1);const D=requestAnimationFrame(()=>{requestAnimationFrame(()=>{z(!0),B.current=!0})});return()=>cancelAnimationFrame(D)},[te,ye==null?void 0:ye.assetId,Te==null?void 0:Te.assetId]),s.useEffect(()=>{if(te!=="open")return;const D=()=>{const Je=Pt=>{Pt.stopPropagation(),Pt.preventDefault(),document.removeEventListener("click",Je,!0)};document.addEventListener("click",Je,!0)},Le=Je=>{const Pt=Je<0?1:-1;Ie(),Ae(Pt),$.current=Pt,ve(Pt),Be(!0),St()},Ne=Je=>{if(Math.abs(Je)>Av&&Qe){Le(Je);return}$.current=null,ve(null),Ee(null),Se(null),Be(!0),V(0),mt()},Oe=Je=>{if(Je.touches.length!==1||R.current)return;const Pt=Je.touches[0];Y.current=!0,j.current={x:Pt.clientX,y:Pt.clientY},T.current="none",_.current=0,L.current=!1},yt=Je=>{if(!j.current||Je.touches.length!==1||R.current)return;const Pt=Je.touches[0],$t=Pt.clientX-j.current.x,_t=Pt.clientY-j.current.y;if(T.current==="none"){if(Math.abs($t)<10&&Math.abs(_t)<10)return;if(Math.abs($t)>Math.abs(_t)){if(!Qe)return;T.current="horizontal"}else if(_t>0){if(!Ue)return;T.current="vertical"}else return}if(T.current==="horizontal"){L.current=!0,ce(!0),_.current=$t,V($t),Je.preventDefault();return}T.current==="vertical"&&(L.current=!0,ce(!0),N.current=_t,de(_t),Je.preventDefault())},Tt=()=>{if(!j.current)return;const Je=T.current,Pt=L.current;if(Pt&&Je==="horizontal")Ne(_.current),D();else if(Pt&&Je==="vertical"){const $t=N.current;if(Ue&&$t>kv){const _t=window.innerHeight;N.current=_t,H(!0),de(_t),fe("closing")}else N.current=0,de(0);D()}else Je==="horizontal"&&Math.abs(_.current)>0&&(Ne(_.current),D());j.current=null,T.current="none",_.current=0,L.current=!1,ce(!1)};return document.addEventListener("touchstart",Oe,{passive:!0}),document.addEventListener("touchmove",yt,{passive:!1}),document.addEventListener("touchend",Tt),document.addEventListener("touchcancel",Tt),()=>{document.removeEventListener("touchstart",Oe),document.removeEventListener("touchmove",yt),document.removeEventListener("touchend",Tt),document.removeEventListener("touchcancel",Tt)}},[te,Qe,Be,mt,Ie,Ue,St,Ae]);const Lt=s.useCallback(()=>{const D=(m==null?void 0:m())??S??null;D&&q&&(re(D),Z(!0)),fe("closing")},[m,S,q]);s.useEffect(()=>{const D=Oe=>{if(Oe.key==="Escape"){if(r&&c||te==="closing")return;ht(),Lt();return}if(Oe.key!=="ArrowLeft"&&Oe.key!=="ArrowRight"||te!=="open"||!Qe)return;Oe.preventDefault();const yt=Oe.key==="ArrowLeft"?-1:1;Oe.repeat&&U.current===yt||Zt(yt)},Le=Oe=>{if(Oe.key!=="ArrowLeft"&&Oe.key!=="ArrowRight")return;const yt=Oe.key==="ArrowLeft"?-1:1;U.current===yt&&ht()},Ne=()=>{ht()};return window.addEventListener("keydown",D),window.addEventListener("keyup",Le),window.addEventListener("blur",Ne),()=>{window.removeEventListener("keydown",D),window.removeEventListener("keyup",Le),window.removeEventListener("blur",Ne),ht()}},[te,r,c,Lt,Qe,Zt,ht]),s.useEffect(()=>{te!=="open"&&ht()},[te,ht]);const wt=()=>{te==="closing"||l||Lt()},vt=te==="open",Nt=te==="closing",Wt=Pe>0?Math.max(0,1-Pe/500):1,Dt=Pe>0?Math.max(.35,1-Pe/500):1,Me=s.useCallback(D=>{if(!(D.propertyName!=="transform"||!R.current)){if($.current!==null){rt();return}Ie(),Be(!1)}},[Ie,Be,rt]),ct=te==="closing"?J??S:S,dt=ct&&q&&(te==="opening"||Nt)?Hv(ct,q):void 0,kt=Xe&&W?Ct(W,"center"):Pe>0?`translateY(${Pe}px)`:dt,Ke=q?Br(q,k):null,st=!!(ct&&q),It=st&&(te==="closing"||te==="open"&&g),At={position:"absolute",top:Ke==null?void 0:Ke.top,left:Ke==null?void 0:Ke.left,width:Ke==null?void 0:Ke.width,height:Ke==null?void 0:Ke.height,objectFit:"contain",transformOrigin:"top left",transform:kt,opacity:Pe>0?Dt:st?1:te==="opening"||Nt?0:1,transition:ne&&!ie?"none":ie?`transform ${qo}ms ${Cn}`:ee?`transform ${On}ms ${Cn}, opacity ${On}ms ${Cn}`:It?`transform ${On}ms ${Cn}`:te==="opening"||Nt?`opacity ${On}ms ${Cn}`:"none",pointerEvents:"none",zIndex:1,overflow:ke||ze?"hidden":void 0},ut={width:"100%",height:"100%",display:"block",objectFit:"contain",pointerEvents:"none"},Xt=(D,Le,Ne="adjacent")=>{const Oe=_e(D);if(!Oe)return{display:"none"};const yt=Ne==="far"?Le==="left"?"far-left":"far-right":Le==="left"?"left-adjacent":"right-adjacent",{start:Tt}=le!==null?up(Oe,yt,le,k):{start:Ne==="far"?$a(Oe,Le,k):Mo(Oe,Le,k)},Je=Br(Tt,k),Pt=Ct(D,yt),$t=!Xe&&Ne==="adjacent"&&vt&&!he?qv(Oe,Le,k):null,_t=Ne==="far"&&Xe&&le===(Le==="left"?-1:1),on=ne&&!ie?!1:ie,fn=Ne==="adjacent"&&vt&&he&&!Xe;return{position:"absolute",top:Je.top,left:Je.left,width:Je.width,height:Je.height,objectFit:"contain",transform:Pt??($t?`translate(${$t.x}px, ${$t.y}px)`:void 0),opacity:Ne==="far"?vt&&_t?1:0:vt?1:0,transition:on?Ne==="far"?`transform ${qo}ms ${Cn}`:`transform ${qo}ms ${Cn}, opacity ${On}ms ${Cn}`:fn?`transform ${On}ms ${Cn}`:te==="opening"||Nt?`opacity ${On}ms ${Cn}`:"none",pointerEvents:"none",zIndex:1}},Ut=(D,Le)=>{const Ne=_e(D);return Ne?Xv(Mo(Ne,Le,k),Le,k):null},Ot=D=>Le=>{if(!l){if(Y.current){Y.current=!1;return}Le.stopPropagation(),Rt(D)}},Bt=ye?Ut(ye,"left"):null,jt=Te?Ut(Te,"right"):null,zt=Bt?Br(Bt,k):null,Kt=jt?Br(jt,k):null;return a.jsxs("div",{ref:F,className:[`${e}-lightbox`,r?`${e}-lightbox-editor`:"",l?`${e}-lightbox-edit-mode`:""].filter(Boolean).join(" "),style:{touchAction:te==="open"?"none":void 0},onClick:wt,children:[a.jsx("div",{style:{position:"absolute",inset:0,background:o.backgroundColor??"#FFFFFF",opacity:vt?Wt:0,transition:ne?"none":`opacity ${On}ms ${Cn}`,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:v,style:{width:"100%",height:"100%"}})}),a.jsx("div",{style:{height:"10%"}})]}),a.jsx("div",{style:{position:"absolute",inset:0,opacity:vt?1:0,transition:ne?"none":`opacity ${On}ms ${Cn}`,pointerEvents:"none"},children:a.jsx(lp,{prefix:e,entry:i,settings:o,isEditor:r,isEditMode:l,isPreviewMode:c,onClose:wt})})]}),vt&&xt&&a.jsx(jr,{media:xt,style:Xt(xt,"left","far"),onMeasure:De,onTransitionEnd:Me},`far-prev-${xt.assetId}`),vt&&ye&&a.jsxs(a.Fragment,{children:[a.jsx(jr,{media:ye,style:Xt(ye,"left"),onMeasure:De,onTransitionEnd:Me},`prev-${ye.assetId}`),zt&&a.jsx("div",{style:{position:"absolute",top:zt.top,left:zt.left,width:zt.width,height:zt.height,cursor:l||ne?"default":"pointer",pointerEvents:l||ne?"none":"auto",zIndex:3},onClick:Ot(-1)})]}),vt&&Te&&a.jsxs(a.Fragment,{children:[a.jsx(jr,{media:Te,style:Xt(Te,"right"),onMeasure:De,onTransitionEnd:Me},`next-${Te.assetId}`),Kt&&a.jsx("div",{style:{position:"absolute",top:Kt.top,left:Kt.left,width:Kt.width,height:Kt.height,cursor:l||ne?"default":"pointer",pointerEvents:l||ne?"none":"auto",zIndex:3},onClick:Ot(1)})]}),vt&&pt&&a.jsx(jr,{media:pt,style:Xt(pt,"right","far"),onMeasure:De,onTransitionEnd:Me},`far-next-${pt.assetId}`),q&&W&&(ze?a.jsx("div",{style:At,onTransitionEnd:Me,children:a.jsx(b.EmbedMediaFrame,{media:W,fit:"contain",lazy:!1,startsAtOnce:!0,style:ut})},`${n}-${W.assetId}`):ke?a.jsx(Zv,{src:W.assetId,onMediaElement:Ge,wrapperStyle:At,videoStyle:ut,onLoadedMetadata:$e,onTransitionEnd:Me},`${n}-${W.assetId}`):a.jsx("img",{ref:Ge,src:W.assetId,alt:W.name,onLoad:$e,onTransitionEnd:Me,style:At},`${n}-${W.assetId}`))]})}function e0({settings:e,content:t,isEditor:n,isPreviewMode:i,isEditMode:o,layoutId:r,portalId:l}){const{prefix:c}=b.useScopedStyles(),{gridLayout:d,verticalGap:u,align:p="top",imageDisplay:y}=e,S=(y==null?void 0:y.display)==="cover",m=(y==null?void 0:y.ratioValue)??"1:1",h=(y==null?void 0:y.reversed)??!1,[x,w]=m.split(":").map(Number),P=`${h?w:x} / ${h?x:w}`,M=d.entryWidth??.2,K=d.columnsCount,X=b.scalingValue(M,n),j=b.scalingValue(d.horizontalGap??0,n),N=X,_=X,T={width:N,...S?{aspectRatio:P,height:"auto",overflow:"hidden"}:{height:"auto"}},L=S?{objectFit:"cover",pointerEvents:"auto",width:"100%",height:"100%",maxWidth:"100%"}:{objectFit:"contain",pointerEvents:"auto",width:"auto",height:"auto",maxWidth:"100%"},Y=s.useRef(null),[R,I]=s.useState(!1),[$,G]=s.useState([]),[O,U]=s.useState(0),[E,f]=s.useState(0),[Q,q]=s.useState(null),[pe,k]=s.useState({title1:"",title2:"",title3:""}),me=(()=>{const Ce={},Se=Y.current?getComputedStyle(Y.current).getPropertyValue("--cntrl-article-width").trim():"";return Se&&(Ce["--cntrl-article-width"]=Se),Ce})(),C=!n||i||o,ue=s.useMemo(()=>Rv(c),[c]),te=t??[],fe=te.length%K||K,Pe=fe<K&&te.length>0,de=te.length-fe,we=Pe?Math.floor((K-fe)/2)+1:1,V=s.useMemo(()=>Ov(te),[te]),ie=s.useMemo(()=>Vv(te),[te]),oe=(Ce,Se,g)=>{if(n&&!o&&!i)return;const Z=V.findIndex(re=>re.gridIndex===Ce);if(Z<0)return;const J=V[Z];f(Z),G(J.items),U(Se),k(J.entry),q(g??null),I(!0)},le=s.useCallback(()=>{I(!1),q(null)},[]),ve=s.useCallback(()=>{const Ce=V[E];return!Ce||!Y.current?Q:Wv(Y.current,Ce.gridIndex,S?"cover":"contain")??Q},[V,E,Q,S]),Fe=s.useCallback(Ce=>{if(V.length>1){const Se=V.length,g=(E+Ce+Se)%Se,Z=V[g],J=Math.min(O,Z.items.length-1);f(g),G(Z.items),U(J),k(Z.entry);return}U(Se=>(Se+Ce+$.length)%$.length)},[V,E,O,$.length]),Ee=V.length>1||$.length>1;return s.useEffect(()=>{if(!R||typeof document>"u")return;const Ce=document.body.style.overflow;return document.body.style.overflow="hidden",()=>{document.body.style.overflow=Ce}},[R]),s.useEffect(()=>{!n||o||i||I(!1)},[n,o,i]),a.jsxs(a.Fragment,{children:[a.jsx("style",{dangerouslySetInnerHTML:{__html:ue}}),a.jsx(Gv,{mediaList:ie}),a.jsx("div",{ref:Y,className:`${c}-wrapper ${c}-align-entries ${c}-image-align-${p}`.trim(),style:{gridTemplateColumns:`repeat(${K}, ${X})`,rowGap:0,columnGap:j,width:b.scalingValue(d.wrapperWidth??0,n),[`--${c}-align-entries-row-gap`]:b.scalingValue(u??0,n)},children:te.map((Ce,Se)=>{const g=Wl(Ce.gallery),Z=Ol(g),J=Z.filter(ce=>ce.lightboxMedia).map(ce=>ce.lightboxMedia),re=Math.floor(Se/K)===Math.ceil(te.length/K)-1,he=Pe&&Se>=de?`${we+(Se-de)}`:void 0,z=Z[0],B=z!=null&&z.lightboxMedia?J.findIndex(ce=>ce.assetId===z.lightboxMedia.assetId):-1,ne=a.jsx("div",{className:`${c}-item-image-wrapper`,style:T,children:Z.length>0&&a.jsx(Qv,{media:z.displayMedia,gridIndex:Se,className:`${c}-item-${Bo(z.displayMedia)?"video":"image"}`.trim(),style:L,onMediaClick:C&&B>=0?ce=>oe(Se,B,cp(ce.currentTarget,S?"cover":"contain")):void 0})});return a.jsx("div",{className:`${c}-item`,children:a.jsxs("div",{className:[o?`${c}-item-inner`:`${c}-item-inner-hidden`,re?`${c}-item-inner-last-row`:""].filter(Boolean).join(" "),style:{width:X,...he?{gridColumn:he}:{}},children:[a.jsx("div",{className:`${c}-item-title-row`,children:a.jsx("div",{style:{height:0,width:_}})}),a.jsx("a",{className:`${c}-item-image-link`,children:ne}),a.jsx("div",{className:`${c}-item-subtitle-row`,children:a.jsx("div",{style:{height:0,width:_}})})]})},Se)})}),R&&typeof document<"u"&&(()=>{const Ce=(l?document.getElementById(l):null)??document.body;return qn.createPortal(a.jsx("div",{style:me,"data-selection":"none",children:a.jsx(Jv,{prefix:c,items:$,index:O,entry:pe,settings:e,isEditor:n,isEditMode:o,isPreviewMode:i,canNavigate:Ee,lightboxEntries:V,entryIdx:E,layoutId:r,sourceRect:Q,resolveCloseSourceRect:ve,onClose:le,onPrev:()=>Fe(-1),onNext:()=>Fe(1)})}),Ce)})()]})}const t0=`import { CommonComponentProps } from '../props';
|
|
7901
|
+
`}const _c={assetId:"",name:"",objectFit:"cover"},On=500,qo=650,Cn="cubic-bezier(0.22, 1, 0.36, 1)",kv=72,Av=50,Fv=1e4,Nv=650,_v=500;function Hv(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 cp(e,t){if(t==="contain"&&e instanceof HTMLImageElement){const i=wa(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 Wv(e,t,n){const i=e.querySelector(`[data-hive-grid-index="${t}"]`);return i instanceof HTMLElement?cp(i,n):null}function Ov(e){return e.reduce((t,n,i)=>{const o=Wl(n.gallery),l=Ol(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 ir(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 Hc(e,t,n){if(e.length<=2)return null;const i=(t+n+e.length)%e.length;return ir(e,i,n)}const Dv=.03;function dp(e){return e.width*Dv}const ls={left:0,top:0,width:typeof window<"u"?window.innerWidth:1440,height:typeof window<"u"?window.innerHeight:900};function Br(e,t){return{left:e.left-t.left,top:e.top-t.top,width:e.width,height:e.height}}function Wc(e){const t=e.getBoundingClientRect();return{width:t.width,height:t.height,left:t.left,top:t.top}}function zv(e){return e instanceof HTMLVideoElement?{width:e.videoWidth,height:e.videoHeight}:{width:e.naturalWidth,height:e.naturalHeight}}function Xs(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 Bv(e,t){return!e||!(t!=null&&t.width)||!(t!=null&&t.height)?null:Xs(e,t.width,t.height)}function jv(e,t){if(b.isEmbedMedia(e)){t(e.assetId,b.getEmbedAspect(e),1);return}if(Bo(e)){const i=document.createElement("video"),o=()=>{i.videoWidth>0&&i.videoHeight>0&&t(e.assetId,i.videoWidth,i.videoHeight),i.removeEventListener("loadedmetadata",o)};i.addEventListener("loadedmetadata",o),i.preload="auto",i.src=e.assetId,i.load();return}const n=new Image;n.onload=()=>{n.naturalWidth>0&&n.naturalHeight>0&&t(e.assetId,n.naturalWidth,n.naturalHeight)},n.src=e.assetId}function Vv(e){const t=new Set,n=[];for(const i of e){const o=Wl(i.gallery),r=Ol(o);for(const l of r)for(const c of[l.displayMedia,l.lightboxMedia])c!=null&&c.assetId&&!t.has(c.assetId)&&(t.add(c.assetId),n.push(c))}return n}function Gv({mediaList:e}){const t=e.filter(n=>!b.isEmbedMedia(n));return t.length===0?null:a.jsx("div",{"aria-hidden":!0,style:{position:"absolute",width:0,height:0,overflow:"hidden",opacity:0,pointerEvents:"none"},children:t.map(n=>Bo(n)?a.jsx("video",{src:n.assetId,preload:"auto",muted:!0,playsInline:!0},n.assetId):a.jsx("img",{src:n.assetId,alt:""},n.assetId))})}function Mo(e,t,n){const{width:i,height:o,top:r}=e,{left:l,width:c}=n,d=dp(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 $a(e,t,n){const i=Mo(e,t,n);return{...i,left:2*i.left-e.left}}function Xv(e,t,n){const{left:i,width:o}=n,r=dp(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 up(e,t,n,i){const o=Mo(e,"left",i),r=Mo(e,"right",i),l=$a(e,"left",i),c=$a(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 Uv(e,t,n,i){const{start:o,end:r}=up(e,t,n,i);return{x:r.left-o.left,y:r.top-o.top}}function qv(e,t,n){const i=Mo(e,t,n),o=$a(e,t,n);return{x:o.left-i.left,y:o.top-i.top}}function pp(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 Wl(e){if(!e)return;if(pp(e))return e;if(!Array.isArray(e))return;const[t,n]=e,i=t!=null&&t.assetId?t:void 0,o=n!=null&&n.assetId?n:void 0;if(!(!i&&!o))return[{media:[o??i??_c,i??o??_c]}]}function Kv(e){const[t,n]=e.media;return n!=null&&n.assetId?n:t!=null&&t.assetId?t:null}function Yv(e){const[t]=e.media;return t!=null&&t.assetId?t:null}function Ol(e){if(!Array.isArray(e)||e.length===0)return[];if(pp(e)){const t=[];for(const n of e){const i=Kv(n);if(!i)continue;const o=Yv(n);t.push({displayMedia:i,lightboxMedia:o!=null&&o.assetId?o:null})}return t}return e.filter(t=>t==null?void 0:t.assetId).map(t=>({displayMedia:t,lightboxMedia:t}))}function Bo(e){return b.isEmbedMedia(e)?!1:e.type==="video"?!0:/\.(mp4|webm|ogg|mov)(\?|#|$)/i.test(e.assetId)}function Qv({media:e,className:t,style:n,gridIndex:i,onMediaClick:o}){return b.isEmbedMedia(e)?a.jsx(b.EmbedMediaFrame,{media:e,fit:n.objectFit==="contain"?"contain":"cover",silentLoop:!0,className:t,"data-hive-grid-index":i,style:{...n,cursor:o?"pointer":"default"},onClick:o}):Bo(e)?a.jsx("video",{src:e.assetId,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.assetId,alt:e.name,className:t,"data-hive-grid-index":i,style:{...n,cursor:o?"pointer":"default"},onClick:o})}function Zv({src:e,onMediaElement:t,wrapperStyle:n,videoStyle:i,onLoadedMetadata:o,onTransitionEnd:r}){const l=s.useRef(null);return s.useEffect(()=>{const c=l.current;return t==null||t(c??null),()=>{c==null||c.pause(),t==null||t(null)}},[e,t]),a.jsx("div",{style:n,onTransitionEnd:r,children:a.jsx("video",{ref:l,src:e,muted:!0,autoPlay:!0,loop:!0,playsInline:!0,preload:"auto",onLoadedMetadata:o,style:i},e)})}function jr({media:e,style:t,onTransitionEnd:n,onMeasure:i}){return b.isEmbedMedia(e)?a.jsx("img",{src:e.thumbnail,alt:e.name,style:t,onTransitionEnd:n}):Bo(e)?a.jsx("video",{src:e.assetId,muted:!0,autoPlay:!0,loop:!0,playsInline:!0,preload:"auto",style:t,onLoadedMetadata:o=>{const r=o.currentTarget;r.videoWidth>0&&r.videoHeight>0&&(i==null||i(e.assetId,r.videoWidth,r.videoHeight))},onTransitionEnd:n}):a.jsx("img",{src:e.assetId,alt:e.name,style:t,onLoad:o=>{const r=o.currentTarget;r.naturalWidth>0&&r.naturalHeight>0&&(i==null||i(e.assetId,r.naturalWidth,r.naturalHeight))},onTransitionEnd:n})}function Jv({prefix:e,items:t,index:n,entry:i,settings:o,isEditor:r,isEditMode:l,isPreviewMode:c,canNavigate:d,lightboxEntries:u,entryIdx:p,layoutId:y,sourceRect:S,resolveCloseSourceRect:m,onClose:h,onPrev:x,onNext:w}){const F=s.useRef(null),v=s.useRef(null),P=s.useRef(null),M=s.useRef(new Map),[K,X]=s.useState(0),j=s.useRef(null),N=s.useRef(0),_=s.useRef(0),T=s.useRef("none"),L=s.useRef(!1),Y=s.useRef(!1),R=s.useRef(!1),I=s.useRef(null),$=s.useRef(null),G=s.useRef(null),O=s.useRef(()=>{}),U=s.useRef(null),E=s.useRef(null),f=s.useRef(null),Q=s.useRef(!1),[q,pe]=s.useState(null),[k,me]=s.useState(ls),[C,ue]=s.useState(0),[te,fe]=s.useState("opening"),[Pe,de]=s.useState(0),[we,V]=s.useState(0),[ie,oe]=s.useState(!1),[le,ve]=s.useState(null),[Fe,Ee]=s.useState(null),[Ce,Se]=s.useState(null),[g,Z]=s.useState(!1),[J,re]=s.useState(null),[he,z]=s.useState(!1),B=s.useRef(!1),[ne,ce]=s.useState(!1),[ee,H]=s.useState(!1),be=s.useRef(n),ae=s.useRef(void 0),W=t[n],ke=W?Bo(W):!1,ze=W?b.isEmbedMedia(W):!1,Xe=we!==0||ie,Ue=!l&&(!r||!!c),Qe=d&&!l,We=u.length>1,it=s.useCallback((D,Le)=>t.length<=1?null:t[(D+Le+t.length)%t.length]??null,[t]),ye=We?ir(u,p,-1):it(n,-1),Te=We?ir(u,p,1):it(n,1),Ve=le===-1&&Xe?We&&Fe!==null?ir(u,Fe,-1):Ce!==null?it(Ce,-1):null:null,Ze=le===1&&Xe?We&&Fe!==null?ir(u,Fe,1):Ce!==null?it(Ce,1):null:null,et=Ve&&Ve.assetId!==(ye==null?void 0:ye.assetId)?Ve:null,at=Ze&&Ze.assetId!==(Te==null?void 0:Te.assetId)?Ze:null,tt=ye&&Qe?(()=>{const D=We?Hc(u,p,-1):t.length>2?it((n-1+t.length)%t.length,-1):null;return D&&D.assetId!==ye.assetId?D:null})():null,Ye=Te&&Qe?(()=>{const D=We?Hc(u,p,1):t.length>2?it((n+1)%t.length,1):null;return D&&D.assetId!==Te.assetId?D:null})():null,xt=et??tt,pt=at??Ye,De=s.useCallback((D,Le,Ne)=>{if(!D||!Le||!Ne)return;const Oe=M.current,yt=Oe.get(D);(yt==null?void 0:yt.width)===Le&&(yt==null?void 0:yt.height)===Ne||(Oe.set(D,{width:Le,height:Ne}),X(Tt=>Tt+1))},[]),_e=s.useCallback(D=>{if(!(D!=null&&D.assetId))return null;const Le=M.current.get(D.assetId);return Bv(v.current,Le)},[K,C]),He=s.useCallback(()=>{if(!W)return;const D=_e(W);if(D){pe(D);return}const Le=v.current;Le&&pe(Wc(Le))},[W,_e]),Ae=s.useCallback(D=>{if(We){const Le=u.length;Ee((p+D+Le)%Le),Se(null);return}t.length>1&&(Se((n+D+t.length)%t.length),Ee(null))},[We,u.length,p,t.length,n]),Be=s.useCallback(D=>{R.current=D,oe(D)},[]),Ie=s.useCallback(()=>{I.current!==null&&(window.clearTimeout(I.current),I.current=null)},[]),mt=s.useCallback(()=>{Ie(),I.current=window.setTimeout(()=>{Ie(),Be(!1)},qo+32)},[Ie,Be]),ot=s.useCallback(()=>{const D=F.current;if(!D){me({left:0,top:0,width:typeof window<"u"?window.innerWidth:ls.width,height:typeof window<"u"?window.innerHeight:ls.height});return}const Le=D.getBoundingClientRect();me({left:Le.left,top:Le.top,width:Le.width,height:Le.height})},[]),Ct=s.useCallback((D,Le)=>{if(Xe){if(ne&&!ie)return`translate(${we}px, 0px)`;if(ie&&le!==null){const Ne=_e(D);if(!Ne)return;const{x:Oe,y:yt}=Uv(Ne,Le,le,k);return`translate(${Oe}px, ${yt}px)`}if(ie)return"translate(0px, 0px)"}},[Xe,ne,ie,we,le,k,_e]),rt=s.useCallback(()=>{const D=$.current;$.current=null,Ie(),Be(!1),ve(null),Ee(null),Se(null),V(0),ce(!1),L.current=!1,_.current=0,T.current="none",D===-1?x():D===1&&w()},[Ie,Be,x,w]),St=s.useCallback(()=>{Ie(),I.current=window.setTimeout(()=>{$.current!==null&&rt()},qo+32)},[Ie,rt]),nt=s.useCallback(()=>{Ie(),$.current=null,Be(!1),ve(null),Ee(null),Se(null),V(0),ce(!1),L.current=!1,_.current=0,T.current="none"},[Ie,Be]),Rt=s.useCallback(D=>{if(!(!Qe||!q)){if(R.current){if($.current===D){G.current=D,rt();return}nt()}Ie(),Ae(D),$.current=D,ve(D),Be(!0),St()}},[Qe,q,rt,nt,Ie,Ae,Be,St]);O.current=Rt;const ht=s.useCallback(()=>{U.current=null,Q.current=!1,E.current!==null&&(window.clearInterval(E.current),E.current=null),f.current!==null&&(window.clearTimeout(f.current),f.current=null)},[]),Vt=s.useCallback(D=>{E.current!==null&&window.clearInterval(E.current);const Le=Q.current?_v:Nv;E.current=window.setInterval(()=>{O.current(D)},Le)},[]),Zt=s.useCallback(D=>{U.current!==D&&(ht(),U.current=D,Q.current=!1,O.current(D),Vt(D),f.current=window.setTimeout(()=>{f.current=null,U.current===D&&(Q.current=!0,Vt(D))},Fv))},[ht,Vt]),$e=s.useCallback(()=>{const D=v.current;if(!D)return;const Le=W==null?void 0:W.assetId,Ne=Le?M.current.get(Le):void 0;if(Ne!=null&&Ne.width&&(Ne!=null&&Ne.height)){pe(Xs(D,Ne.width,Ne.height));return}const Oe=P.current;if(Oe&&Le&&(Oe.src===Le||Oe.currentSrc===Le)){const{width:Tt,height:Je}=zv(Oe);if(Tt&&Je){De(Le,Tt,Je),pe(Xs(D,Tt,Je));return}}const yt=Wc(D);!yt.width||!yt.height||pe(yt)},[W==null?void 0:W.assetId,De]),Ge=s.useCallback(D=>{if(P.current=D,!!D){if(D instanceof HTMLVideoElement){D.readyState>=1&&D.videoWidth>0&&$e();return}D.complete&&D.naturalWidth>0&&$e()}},[$e]),ft=s.useCallback(()=>{ot(),$e(),ue(D=>D+1)},[ot,$e]);s.useEffect(()=>{ft();const D=v.current,Le=F.current,Ne=new ResizeObserver(()=>ft());return D&&Ne.observe(D),Le&&Ne.observe(Le),window.addEventListener("resize",ft),()=>{Ne.disconnect(),window.removeEventListener("resize",ft)}},[ft,n,y]),s.useLayoutEffect(()=>{if(!W)return;const D=P.current;if(D){if(D instanceof HTMLImageElement&&D.complete&&D.naturalWidth>0){$e();return}D instanceof HTMLVideoElement&&D.readyState>=1&&D.videoWidth>0&&$e()}},[W==null?void 0:W.assetId,n,$e]),s.useEffect(()=>{He()},[He,K]),s.useEffect(()=>{const D=new Set,Le=[],Ne=Oe=>{!(Oe!=null&&Oe.assetId)||D.has(Oe.assetId)||(D.add(Oe.assetId),Le.push(Oe))};t.forEach(Ne),u.forEach(Oe=>Oe.items.forEach(Ne)),Le.forEach(Oe=>{M.current.has(Oe.assetId)||jv(Oe,De)})},[t,u,De]),s.useEffect(()=>{if(te!=="opening"||!q)return;if(!S){fe("open");return}Z(!1);const D=requestAnimationFrame(()=>{requestAnimationFrame(()=>{Z(!0),fe("open")})});return()=>cancelAnimationFrame(D)},[te,q,S]),s.useEffect(()=>{if(te!=="closing")return;const D=setTimeout(()=>h(),On);return()=>clearTimeout(D)},[te,h]),s.useEffect(()=>()=>{Ie()},[Ie]),s.useLayoutEffect(()=>{be.current===n&&ae.current===(W==null?void 0:W.assetId)||(Ie(),$.current=null,ve(null),Ee(null),Se(null),de(0),V(0),Be(!1),H(!1),ce(!1),N.current=0,_.current=0,T.current="none",L.current=!1,j.current=null,Y.current=!1,P.current=null,He(),be.current=n,ae.current=W==null?void 0:W.assetId)},[n,W==null?void 0:W.assetId,Be,Ie,He]),s.useLayoutEffect(()=>{const D=G.current;D!==null&&(G.current=null,requestAnimationFrame(()=>{O.current(D)}))},[n,p,W==null?void 0:W.assetId]),s.useLayoutEffect(()=>{if(te==="opening"){B.current=!1,z(!1);return}if(te!=="open"||B.current)return;if(!ye&&!Te){B.current=!0;return}z(!1);const D=requestAnimationFrame(()=>{requestAnimationFrame(()=>{z(!0),B.current=!0})});return()=>cancelAnimationFrame(D)},[te,ye==null?void 0:ye.assetId,Te==null?void 0:Te.assetId]),s.useEffect(()=>{if(te!=="open")return;const D=()=>{const Je=Pt=>{Pt.stopPropagation(),Pt.preventDefault(),document.removeEventListener("click",Je,!0)};document.addEventListener("click",Je,!0)},Le=Je=>{const Pt=Je<0?1:-1;Ie(),Ae(Pt),$.current=Pt,ve(Pt),Be(!0),St()},Ne=Je=>{if(Math.abs(Je)>Av&&Qe){Le(Je);return}$.current=null,ve(null),Ee(null),Se(null),Be(!0),V(0),mt()},Oe=Je=>{if(Je.touches.length!==1||R.current)return;const Pt=Je.touches[0];Y.current=!0,j.current={x:Pt.clientX,y:Pt.clientY},T.current="none",_.current=0,L.current=!1},yt=Je=>{if(!j.current||Je.touches.length!==1||R.current)return;const Pt=Je.touches[0],$t=Pt.clientX-j.current.x,_t=Pt.clientY-j.current.y;if(T.current==="none"){if(Math.abs($t)<10&&Math.abs(_t)<10)return;if(Math.abs($t)>Math.abs(_t)){if(!Qe)return;T.current="horizontal"}else if(_t>0){if(!Ue)return;T.current="vertical"}else return}if(T.current==="horizontal"){L.current=!0,ce(!0),_.current=$t,V($t),Je.preventDefault();return}T.current==="vertical"&&(L.current=!0,ce(!0),N.current=_t,de(_t),Je.preventDefault())},Tt=()=>{if(!j.current)return;const Je=T.current,Pt=L.current;if(Pt&&Je==="horizontal")Ne(_.current),D();else if(Pt&&Je==="vertical"){const $t=N.current;if(Ue&&$t>kv){const _t=window.innerHeight;N.current=_t,H(!0),de(_t),fe("closing")}else N.current=0,de(0);D()}else Je==="horizontal"&&Math.abs(_.current)>0&&(Ne(_.current),D());j.current=null,T.current="none",_.current=0,L.current=!1,ce(!1)};return document.addEventListener("touchstart",Oe,{passive:!0}),document.addEventListener("touchmove",yt,{passive:!1}),document.addEventListener("touchend",Tt),document.addEventListener("touchcancel",Tt),()=>{document.removeEventListener("touchstart",Oe),document.removeEventListener("touchmove",yt),document.removeEventListener("touchend",Tt),document.removeEventListener("touchcancel",Tt)}},[te,Qe,Be,mt,Ie,Ue,St,Ae]);const Lt=s.useCallback(()=>{const D=(m==null?void 0:m())??S??null;D&&q&&(re(D),Z(!0)),fe("closing")},[m,S,q]);s.useEffect(()=>{const D=Oe=>{if(Oe.key==="Escape"){if(r&&c||te==="closing")return;ht(),Lt();return}if(Oe.key!=="ArrowLeft"&&Oe.key!=="ArrowRight"||te!=="open"||!Qe)return;Oe.preventDefault();const yt=Oe.key==="ArrowLeft"?-1:1;Oe.repeat&&U.current===yt||Zt(yt)},Le=Oe=>{if(Oe.key!=="ArrowLeft"&&Oe.key!=="ArrowRight")return;const yt=Oe.key==="ArrowLeft"?-1:1;U.current===yt&&ht()},Ne=()=>{ht()};return window.addEventListener("keydown",D),window.addEventListener("keyup",Le),window.addEventListener("blur",Ne),()=>{window.removeEventListener("keydown",D),window.removeEventListener("keyup",Le),window.removeEventListener("blur",Ne),ht()}},[te,r,c,Lt,Qe,Zt,ht]),s.useEffect(()=>{te!=="open"&&ht()},[te,ht]);const wt=()=>{te==="closing"||l||Lt()},vt=te==="open",Nt=te==="closing",Wt=Pe>0?Math.max(0,1-Pe/500):1,Dt=Pe>0?Math.max(.35,1-Pe/500):1,Me=s.useCallback(D=>{if(!(D.propertyName!=="transform"||!R.current)){if($.current!==null){rt();return}Ie(),Be(!1)}},[Ie,Be,rt]),ct=te==="closing"?J??S:S,dt=ct&&q&&(te==="opening"||Nt)?Hv(ct,q):void 0,kt=Xe&&W?Ct(W,"center"):Pe>0?`translateY(${Pe}px)`:dt,Ke=q?Br(q,k):null,st=!!(ct&&q),It=st&&(te==="closing"||te==="open"&&g),At={position:"absolute",top:Ke==null?void 0:Ke.top,left:Ke==null?void 0:Ke.left,width:Ke==null?void 0:Ke.width,height:Ke==null?void 0:Ke.height,objectFit:"contain",transformOrigin:"top left",transform:kt,opacity:Pe>0?Dt:st?1:te==="opening"||Nt?0:1,transition:ne&&!ie?"none":ie?`transform ${qo}ms ${Cn}`:ee?`transform ${On}ms ${Cn}, opacity ${On}ms ${Cn}`:It?`transform ${On}ms ${Cn}`:te==="opening"||Nt?`opacity ${On}ms ${Cn}`:"none",pointerEvents:"none",zIndex:1,overflow:ke||ze?"hidden":void 0},ut={width:"100%",height:"100%",display:"block",objectFit:"contain",pointerEvents:"none"},Gt=(D,Le,Ne="adjacent")=>{const Oe=_e(D);if(!Oe)return{display:"none"};const yt=Ne==="far"?Le==="left"?"far-left":"far-right":Le==="left"?"left-adjacent":"right-adjacent",{start:Tt}=le!==null?up(Oe,yt,le,k):{start:Ne==="far"?$a(Oe,Le,k):Mo(Oe,Le,k)},Je=Br(Tt,k),Pt=Ct(D,yt),$t=!Xe&&Ne==="adjacent"&&vt&&!he?qv(Oe,Le,k):null,_t=Ne==="far"&&Xe&&le===(Le==="left"?-1:1),on=ne&&!ie?!1:ie,fn=Ne==="adjacent"&&vt&&he&&!Xe;return{position:"absolute",top:Je.top,left:Je.left,width:Je.width,height:Je.height,objectFit:"contain",transform:Pt??($t?`translate(${$t.x}px, ${$t.y}px)`:void 0),opacity:Ne==="far"?vt&&_t?1:0:vt?1:0,transition:on?Ne==="far"?`transform ${qo}ms ${Cn}`:`transform ${qo}ms ${Cn}, opacity ${On}ms ${Cn}`:fn?`transform ${On}ms ${Cn}`:te==="opening"||Nt?`opacity ${On}ms ${Cn}`:"none",pointerEvents:"none",zIndex:1}},Ut=(D,Le)=>{const Ne=_e(D);return Ne?Xv(Mo(Ne,Le,k),Le,k):null},Ot=D=>Le=>{if(!l){if(Y.current){Y.current=!1;return}Le.stopPropagation(),Rt(D)}},Bt=ye?Ut(ye,"left"):null,Xt=Te?Ut(Te,"right"):null,zt=Bt?Br(Bt,k):null,Kt=Xt?Br(Xt,k):null;return a.jsxs("div",{ref:F,className:[`${e}-lightbox`,r?`${e}-lightbox-editor`:"",l?`${e}-lightbox-edit-mode`:""].filter(Boolean).join(" "),style:{touchAction:te==="open"?"none":void 0},onClick:wt,children:[a.jsx("div",{style:{position:"absolute",inset:0,background:o.backgroundColor??"#FFFFFF",opacity:vt?Wt:0,transition:ne?"none":`opacity ${On}ms ${Cn}`,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:v,style:{width:"100%",height:"100%"}})}),a.jsx("div",{style:{height:"10%"}})]}),a.jsx("div",{style:{position:"absolute",inset:0,opacity:vt?1:0,transition:ne?"none":`opacity ${On}ms ${Cn}`,pointerEvents:"none"},children:a.jsx(lp,{prefix:e,entry:i,settings:o,isEditor:r,isEditMode:l,isPreviewMode:c,onClose:wt})})]}),vt&&xt&&a.jsx(jr,{media:xt,style:Gt(xt,"left","far"),onMeasure:De,onTransitionEnd:Me},`far-prev-${xt.assetId}`),vt&&ye&&a.jsxs(a.Fragment,{children:[a.jsx(jr,{media:ye,style:Gt(ye,"left"),onMeasure:De,onTransitionEnd:Me},`prev-${ye.assetId}`),zt&&a.jsx("div",{style:{position:"absolute",top:zt.top,left:zt.left,width:zt.width,height:zt.height,cursor:l||ne?"default":"pointer",pointerEvents:l||ne?"none":"auto",zIndex:3},onClick:Ot(-1)})]}),vt&&Te&&a.jsxs(a.Fragment,{children:[a.jsx(jr,{media:Te,style:Gt(Te,"right"),onMeasure:De,onTransitionEnd:Me},`next-${Te.assetId}`),Kt&&a.jsx("div",{style:{position:"absolute",top:Kt.top,left:Kt.left,width:Kt.width,height:Kt.height,cursor:l||ne?"default":"pointer",pointerEvents:l||ne?"none":"auto",zIndex:3},onClick:Ot(1)})]}),vt&&pt&&a.jsx(jr,{media:pt,style:Gt(pt,"right","far"),onMeasure:De,onTransitionEnd:Me},`far-next-${pt.assetId}`),q&&W&&(ze?a.jsx("div",{style:At,onTransitionEnd:Me,children:a.jsx(b.EmbedMediaFrame,{media:W,fit:"contain",lazy:!1,startsAtOnce:!0,style:ut})},`${n}-${W.assetId}`):ke?a.jsx(Zv,{src:W.assetId,onMediaElement:Ge,wrapperStyle:At,videoStyle:ut,onLoadedMetadata:$e,onTransitionEnd:Me},`${n}-${W.assetId}`):a.jsx("img",{ref:Ge,src:W.assetId,alt:W.name,onLoad:$e,onTransitionEnd:Me,style:At},`${n}-${W.assetId}`))]})}function e0({settings:e,content:t,isEditor:n,isPreviewMode:i,isEditMode:o,layoutId:r,portalId:l}){const{prefix:c}=b.useScopedStyles(),{gridLayout:d,verticalGap:u,align:p="top",imageDisplay:y}=e,S=(y==null?void 0:y.display)==="cover",m=(y==null?void 0:y.ratioValue)??"1:1",h=(y==null?void 0:y.reversed)??!1,[x,w]=m.split(":").map(Number),P=`${h?w:x} / ${h?x:w}`,M=d.entryWidth??.2,K=d.columnsCount,X=b.scalingValue(M,n),j=b.scalingValue(d.horizontalGap??0,n),N=X,_=X,T={width:N,...S?{aspectRatio:P,height:"auto",overflow:"hidden"}:{height:"auto"}},L=S?{objectFit:"cover",pointerEvents:"auto",width:"100%",height:"100%",maxWidth:"100%"}:{objectFit:"contain",pointerEvents:"auto",width:"auto",height:"auto",maxWidth:"100%"},Y=s.useRef(null),[R,I]=s.useState(!1),[$,G]=s.useState([]),[O,U]=s.useState(0),[E,f]=s.useState(0),[Q,q]=s.useState(null),[pe,k]=s.useState({title1:"",title2:"",title3:""}),me=(()=>{const Ce={},Se=Y.current?getComputedStyle(Y.current).getPropertyValue("--cntrl-article-width").trim():"";return Se&&(Ce["--cntrl-article-width"]=Se),Ce})(),C=!n||i||o,ue=s.useMemo(()=>Rv(c),[c]),te=t??[],fe=te.length%K||K,Pe=fe<K&&te.length>0,de=te.length-fe,we=Pe?Math.floor((K-fe)/2)+1:1,V=s.useMemo(()=>Ov(te),[te]),ie=s.useMemo(()=>Vv(te),[te]),oe=(Ce,Se,g)=>{if(n&&!o&&!i)return;const Z=V.findIndex(re=>re.gridIndex===Ce);if(Z<0)return;const J=V[Z];f(Z),G(J.items),U(Se),k(J.entry),q(g??null),I(!0)},le=s.useCallback(()=>{I(!1),q(null)},[]),ve=s.useCallback(()=>{const Ce=V[E];return!Ce||!Y.current?Q:Wv(Y.current,Ce.gridIndex,S?"cover":"contain")??Q},[V,E,Q,S]),Fe=s.useCallback(Ce=>{if(V.length>1){const Se=V.length,g=(E+Ce+Se)%Se,Z=V[g],J=Math.min(O,Z.items.length-1);f(g),G(Z.items),U(J),k(Z.entry);return}U(Se=>(Se+Ce+$.length)%$.length)},[V,E,O,$.length]),Ee=V.length>1||$.length>1;return s.useEffect(()=>{if(!R||typeof document>"u")return;const Ce=document.body.style.overflow;return document.body.style.overflow="hidden",()=>{document.body.style.overflow=Ce}},[R]),s.useEffect(()=>{!n||o||i||I(!1)},[n,o,i]),a.jsxs(a.Fragment,{children:[a.jsx("style",{dangerouslySetInnerHTML:{__html:ue}}),a.jsx(Gv,{mediaList:ie}),a.jsx("div",{ref:Y,className:`${c}-wrapper ${c}-align-entries ${c}-image-align-${p}`.trim(),style:{gridTemplateColumns:`repeat(${K}, ${X})`,rowGap:0,columnGap:j,width:b.scalingValue(d.wrapperWidth??0,n),[`--${c}-align-entries-row-gap`]:b.scalingValue(u??0,n)},children:te.map((Ce,Se)=>{const g=Wl(Ce.gallery),Z=Ol(g),J=Z.filter(ce=>ce.lightboxMedia).map(ce=>ce.lightboxMedia),re=Math.floor(Se/K)===Math.ceil(te.length/K)-1,he=Pe&&Se>=de?`${we+(Se-de)}`:void 0,z=Z[0],B=z!=null&&z.lightboxMedia?J.findIndex(ce=>ce.assetId===z.lightboxMedia.assetId):-1,ne=a.jsx("div",{className:`${c}-item-image-wrapper`,style:T,children:Z.length>0&&a.jsx(Qv,{media:z.displayMedia,gridIndex:Se,className:`${c}-item-${Bo(z.displayMedia)?"video":"image"}`.trim(),style:L,onMediaClick:C&&B>=0?ce=>oe(Se,B,cp(ce.currentTarget,S?"cover":"contain")):void 0})});return a.jsx("div",{className:`${c}-item`,children:a.jsxs("div",{className:[o?`${c}-item-inner`:`${c}-item-inner-hidden`,re?`${c}-item-inner-last-row`:""].filter(Boolean).join(" "),style:{width:X,...he?{gridColumn:he}:{}},children:[a.jsx("div",{className:`${c}-item-title-row`,children:a.jsx("div",{style:{height:0,width:_}})}),a.jsx("a",{className:`${c}-item-image-link`,children:ne}),a.jsx("div",{className:`${c}-item-subtitle-row`,children:a.jsx("div",{style:{height:0,width:_}})})]})},Se)})}),R&&typeof document<"u"&&(()=>{const Ce=(l?document.getElementById(l):null)??document.body;return qn.createPortal(a.jsx("div",{style:me,"data-selection":"none",children:a.jsx(Jv,{prefix:c,items:$,index:O,entry:pe,settings:e,isEditor:n,isEditMode:o,isPreviewMode:i,canNavigate:Ee,lightboxEntries:V,entryIdx:E,layoutId:r,sourceRect:Q,resolveCloseSourceRect:ve,onClose:le,onPrev:()=>Fe(-1),onNext:()=>Fe(1)})}),Ce)})()]})}const t0=`import { CommonComponentProps } from '../props';
|
|
7902
7902
|
import { EmbedMediaFrame, getEmbedAspect, isEmbedMedia, scalingValue, useScopedStyles } from '../utils/index';
|
|
7903
7903
|
import { useCallback, useEffect, useLayoutEffect, useMemo, useRef, useState } from 'react';
|
|
7904
7904
|
import { createPortal } from 'react-dom';
|
|
@@ -10660,7 +10660,7 @@ a.${e}-list-item {
|
|
|
10660
10660
|
overflow-wrap: anywhere;
|
|
10661
10661
|
word-break: break-word;
|
|
10662
10662
|
}
|
|
10663
|
-
`}const Ri=["AColumn","BColumnWidth","CColumnWidth","DColumnWidth","EColumnWidth"],Dl=["AColumn","BColumn","CColumn","DColumn","EColumn"],si="cutLabel",xr=[...Dl,si],ja=["A","B","C","D","E"];function mp(e){return`${e}ColumnVerticalAlign`}const Us=["Top","Center","Bottom"];function zl(e){const t=String(e??"Top").trim();if(t.toLowerCase().startsWith("baseline")){const i=t.slice(-1).toUpperCase();return ja.includes(i)?`Baseline ${i}`:"Top"}const n=t.toLowerCase();return n==="center"?"Center":n==="bottom"?"Bottom":n==="top"?"Top":t}function b0(e){const t=zl(e);return t.toLowerCase().startsWith("baseline")?!1:t==="Top"||t==="Center"||t==="Bottom"}function S0(e){const t=String(e??"").trim();if(!t.toLowerCase().startsWith("baseline"))return null;const n=t.slice(-1).toUpperCase();return ja.includes(n)?n:null}function gp(e,t,n){const i=S0(e);return i?i===t?!1:b0(n[mp(i)]):!0}function br(e){const t=zl(e);if(t.toLowerCase().startsWith("baseline")){const n=t.slice(-1).toUpperCase();return ja.includes(n)?{kind:"baseline",anchorLetter:n}:{kind:"top"}}return t==="Center"?{kind:"center"}:t==="Bottom"?{kind:"bottom"}:{kind:"top"}}function w0(e,t,n){if(hp(e,t,n))return br(e);const i=br(e);return i.kind==="baseline"?{kind:"top"}:i}function $0(e){const t=br(e);return t.kind==="baseline"?{kind:"top"}:t}function hp(e,t,n){return gp(e,n,t)?br(e).kind==="baseline":!1}function C0(e){const t={};let n=!1;for(const i of ja){const o=mp(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}gp(r,i,e)||(t[o]="Top",n=!0)}return n?t:null}function T0(e){return e==="center"?{flex:"0 0 auto",marginTop:"auto",marginBottom:"auto"}:e==="bottom"?{flex:"0 0 auto",marginTop:"auto"}:{}}function I0(e){const t=br(e).kind;return t==="baseline"?"center":t}function L0(e){return e==="right"?"flex-end":e==="center"?"center":"flex-start"}function Vc(e){return e==="center"?"center":e==="bottom"?"flex-end":"flex-start"}function P0(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 ps(e,t,n,i){const o=e.titleEl;if(!o)return 0;const r=o.closest(`.${n}`);if(!r)return 0;const l=P0(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 M0(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 E0(e,t){return!e||!t?(e&&(e.style.transform=""),0):(e.style.transform=`translateY(${t}px)`,t)}const R0={AColumn:"AColumn",BColumnWidth:"BColumn",CColumnWidth:"CColumn",DColumnWidth:"DColumn",EColumnWidth:"EColumn"};function Qt(e,t){return`${e}${t.replace(/^text/,"Text")}`}const k0={AColumn:"A",BColumn:"B",CColumn:"C",DColumn:"D",EColumn:"E",cutLabel:"CUT"};function A0(e){return[Qt(e,"textFontFamily"),Qt(e,"textFontSettings"),{type:"row",items:[Qt(e,"textFontSize"),Qt(e,"textLineHeight"),Qt(e,"textLetterSpacing"),Qt(e,"textWordSpacing")]},Qt(e,"textTextAlign"),Qt(e,"textTextAppearance"),`${e}VerticalAlign`]}function F0(){return{type:"tab",id:"listColumnTextStyle",tabs:Object.fromEntries(xr.map(e=>[k0[e],A0(e)]))}}function Ca(e,t){const n=i=>{const o=Qt(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===si?"center":"left"),textTextAppearance:n("textTextAppearance"),textColor:e.textColor}}function Gc(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 pn(nn(n,t))}function Xc(e,t,n,i){const o=Ca(e,t),r=o.textFontSize??.01,l=o.textLineHeight;return l!==void 0&&l<r?`${n} ${i}`:n}function Uc(e,t,n,i){const o=Ca(e,t),r=o.textFontSize??.01,l=o.textLineHeight;return l===void 0||l>=r?{}:{[`--${n}-title-leading-gap`]:b.scalingValue((r-l)/2,i)}}const Rn=["AColumnWidth","BColumnWidth","CColumnWidth","DColumnWidth","EColumnWidth"],Ro=["AColumnPaddingLeft","BColumnPaddingLeft","CColumnPaddingLeft","DColumnPaddingLeft","EColumnPaddingLeft"],ko=["AColumnPaddingRight","BColumnPaddingRight","CColumnPaddingRight","DColumnPaddingRight","EColumnPaddingRight"],Ao=["AColumnPaddingBottom","BColumnPaddingBottom","CColumnPaddingBottom","DColumnPaddingBottom","EColumnPaddingBottom"],N0={textColor:"text-color",backgroundColor:"background-color",dividerColor:"divider-color",textHoverColor:"text-hover-color",backgroundHoverColor:"background-hover-color",dividerHoverColor:"divider-hover-color"},_0=["hover","focus","filled","success","error"],qc=.004,po=.004,ms=po,Bl=50,Sr=1440,wr=Bl/Sr;function fp(e){const t=typeof e=="number"&&e>0?e:Sr;return Bl/t}function H0(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 Sr}const yp={AColumnWidth:.02,BColumnWidth:.02,CColumnWidth:.02,DColumnWidth:.02,EColumnWidth:.02};function lr(e){const t=typeof e.wrapperWidth=="number"?e.wrapperWidth:1;return Math.max(0,t)}function W0(e,t=1){const n=t/e;return Object.fromEntries(Rn.map(i=>[i,n]))}function O0(){return Object.fromEntries([...Ro.map(e=>[e,0]),...ko.map(e=>[e,0])])}function D0(){return Object.fromEntries(Ao.map(e=>[e,0]))}function Vr(e){return Object.fromEntries(Rn.map(t=>[t,typeof e[t]=="number"?e[t]:yp[t]]))}function vp(e,t,n){const i=e-wr,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 ga(e,t,n){const i=jl(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 z0(e,t,n){const i={};for(let o=0;o<e;o+=1){const r=Ro[o],l=ko[o],c=typeof n[r]=="number"?n[r]:0,d=typeof n[l]=="number"?n[l]:0,u=vp(t[o]??0,c,d);u.paddingLeft!==c&&(i[r]=u.paddingLeft),u.paddingRight!==d&&(i[l]=u.paddingRight)}return i}function jl(e,t,n){if(e<=0)return[];const i=Rn.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)+wr;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]-wr;if(p<=0)continue;const y=Math.min(d,p);c[u]-=y,d-=y}return[...c,i[e-1]]}function B0(e,t,n){if(e<=1)return{};const i=jl(e,t,n),o={};for(let r=0;r<e-1;r+=1){const l=Rn[r];i[r]!==n[l]&&(o[l]=i[r])}return o}function Kc(e){return Array.isArray(e.columnsOrder)&&e.columnsOrder.length>0?e.columnsOrder:[...Ri]}function j0(e,t){return e.length!==t.length?!1:e.every((n,i)=>n===t[i])}function V0(e,t,n,i){const o=Math.min(i,e.length,Rn.length),r={};for(let l=0;l<o;l+=1){const c=e[l],d=t.indexOf(c);if(d===-1)continue;const u=Rn[d],p=Ro[d],y=ko[d],S=Ao[d],m=Rn[l],h=Ro[l],x=ko[l],w=Ao[l],F=n[u],v=n[p],P=n[y],M=n[S];typeof F=="number"&&(r[m]=F),typeof v=="number"&&(r[h]=v),typeof P=="number"&&(r[x]=P),typeof M=="number"&&(r[w]=M)}return r}function xp(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 G0(e,t){const n=e.columns,i=t.columns;if(typeof n!="number"||n===i)return e;const o=lr(e),r=e.type==="b"||e.type===void 0&&t.type==="b",l={...e,...W0(n,o),...O0()};if(r)for(const c of Ao)typeof t[c]=="number"&&(l[c]=t[c]);else Object.assign(l,D0());return xp(e,l)?l:e}function X0(e,t,n){const i=C0(e);i&&(e={...e,...i});const o=fp(n==null?void 0:n.designWidth),r=e.columns,l=t.columns,c=lr(e),d=lr(t),u=e.type==="b"||e.type===void 0&&t.type==="b",p=typeof r=="number"?r:typeof l=="number"?l:Ri.length,y=P=>{if(u)return P;const M=Vr({...t,...P}),K=lr(P),X=ga(p,K,M),j=z0(p,X,{...t,...P});return Object.keys(j).length===0?P:{...P,...j}};if(typeof r=="number"&&r!==l)return e;const S=Kc(e),m=Kc(t);if(!j0(S,m))return y({...e,...V0(S,m,t,p)});if(c<d&&typeof p=="number"&&!u){const P=Vr({...t,...e});return y({...e,...B0(p,c,P)})}if(u){const P=typeof e.textPaddingLR=="number"?e.textPaddingLR:0,M=Math.max(0,(c-o)/2);return P>M?{...e,textPaddingLR:M}:e}const h=Vr({...t,...e}),x=ga(p,d,Vr(t)),F=ga(p,c,h).some((P,M)=>P<(x[M]??P)),v=Rn.some(P=>{const M=e[P],K=t[P];return typeof M=="number"&&typeof K=="number"&&M!==K});return F||v?y(e):e}function U0(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(wr,i-o-r-wr)}function q0(e,t){return Math.random()*(t-e)+e}function K0(e){return Object.fromEntries(Rn.map(t=>[t,typeof e[t]=="number"?e[t]:yp[t]]))}function gs(e,t,n=0){return Object.fromEntries(t.map(i=>[i,typeof e[i]=="number"?e[i]:n]))}function Y0(e,t,n,i,o,r){return e.slice(0,t).map((l,c)=>{const d=Ro[c],u=ko[c],p=Ao[c];return{key:l,textPrefix:R0[l],widthKey:Rn[c],width:n[Rn[c]],paddingLeftKey:d,paddingRightKey:u,paddingBottomKey:p,paddingLeft:i[d],paddingRight:o[u],paddingBottom:r[p]}})}function Q0({settings:e,content:t,isEditor:n,isPreviewMode:i,isEditMode:o,activeEvent:r,layoutId:l,portalId:c,onUpdateSettings:d}){const{prefix:u}=b.useScopedStyles(),p=!!o,{columns:y,type:S,wrapperWidth:m,entriesCount:h,cellMinHeight:x,dividerWidth:w,showVisibility:F,cut:v,showCut:P,cutCellMinHeight:M,cutLabel:K,imageSize:X,imageOnHover:j,imagePosition:N="cursor",imageInterpolation:_="on",entryHoverEffect:T,entryHoverShowOption:L,rowPaddingTop:Y,rowPaddingBottom:R,rowPaddingTopB:I,columnsOrder:$,textPaddingLR:G,textColor:O,backgroundColor:U,dividerColor:E,textHoverColor:f,backgroundHoverColor:Q,dividerHoverColor:q}=e,[pe,k]=s.useState(void 0),[me,C]=s.useState(null),ue=s.useRef(null),te=j==="on"&&(!n||i),fe=N==="cursor",Pe=fe&&_==="on",{anchorRef:de,onShow:we,onCursorMove:V,exit:ie}=v0(!!(te&&me!==null),Pe),oe=(v??0)>0,le=S==="b",ve=s.useRef(null),Fe=s.useRef(null),[Ee,Ce]=s.useState(null),[Se,g]=s.useState(Sr),Z=fp(Se),J=Math.max(0,((m??0)-Z)/2),re=Math.min(G??0,J),he=Math.max(re,po),z=((m??0)+Z)/2;s.useLayoutEffect(()=>{if(!n){g(Sr);return}const Me=()=>{g(H0(ve.current))};Me();const ct=ve.current;if(!ct)return;const dt=new ResizeObserver(Me);dt.observe(ct);let kt=ct;for(;kt&&!kt.style.getPropertyValue("--cntrl-article-width");)kt=kt.parentElement;return kt&&dt.observe(kt),()=>dt.disconnect()},[n,l]),s.useEffect(()=>{k(void 0)},[v,P,t,h]),s.useEffect(()=>{n&&!i&&k(void 0)},[n,i]);const B=b.buildColorVars(u,{textColor:O,backgroundColor:U,dividerColor:E,textHoverColor:f,backgroundHoverColor:Q,dividerHoverColor:q},N0,_0),ne=r&&r!=="default"?`${u}-state-${r}`:"",ee=`${!n||i?T==="default"?`${u}-entry-hover-default`:T==="blinds"?`${u}-entry-hover-blinds`:T==="reveal"?`${u}-entry-hover-reveal`:"":""} ${ne}`.trim(),H=T==="reveal"&&(!n||i),be=(F==null?void 0:F[0])??!1,ae=(F==null?void 0:F[1])??!1,W=s.useRef(e),ke=s.useRef(l);s.useEffect(()=>{if(!d||!n){W.current=e,ke.current=l;return}if(ke.current!==l){W.current=e,ke.current=l;return}const Me=W.current;if(!(Me!==e))return;if(typeof Me.columns=="number"&&typeof e.columns=="number"&&Me.columns!==e.columns){W.current=e;return}const dt=X0(e,Me,{designWidth:Se});W.current=e,xp(e,dt)&&d(dt)},[e,d,n,l,Se]);const ze=s.useMemo(()=>K0(e),[e.AColumnWidth,e.BColumnWidth,e.CColumnWidth,e.DColumnWidth,e.EColumnWidth]),Xe=s.useMemo(()=>gs(e,Ro),[e.AColumnPaddingLeft,e.BColumnPaddingLeft,e.CColumnPaddingLeft,e.DColumnPaddingLeft,e.EColumnPaddingLeft]),Ue=s.useMemo(()=>gs(e,ko),[e.AColumnPaddingRight,e.BColumnPaddingRight,e.CColumnPaddingRight,e.DColumnPaddingRight,e.EColumnPaddingRight]),Qe=s.useMemo(()=>gs(e,Ao),[e.AColumnPaddingBottom,e.BColumnPaddingBottom,e.CColumnPaddingBottom,e.DColumnPaddingBottom,e.EColumnPaddingBottom]),We=s.useMemo(()=>Array.isArray($)&&$.length>0?$:[...Ri],[$]),it=s.useMemo(()=>Y0(We,y,ze,Xe,Ue,Qe),[We,y,ze,Xe,Ue,Qe]),ye=lr(e),Te=s.useMemo(()=>Rn.slice(0,y).map(Me=>ze[Me]),[y,ze]),Ve=s.useMemo(()=>jl(y,ye,ze),[y,ye,ze]),Ze=s.useMemo(()=>ga(y,ye,ze),[y,ye,ze]),et=s.useMemo(()=>it.map((Me,ct)=>vp(Ze[ct]??0,Me.paddingLeft,Me.paddingRight)),[it,Ze]),at=s.useMemo(()=>{const Me=h===0?1/0:h;return(t??[]).slice(0,Me).map((dt,kt)=>({id:kt,cells:Object.fromEntries(Ri.map(Ke=>[Ke,dt[Ke]??""])),image:dt.image,link:dt.link}))},[t,h]),tt=oe?pe??v:at.length,Ye=s.useMemo(()=>oe?at.slice(0,tt):at,[at,oe,tt]),xt=oe&&tt<at.length,pt=Ye.length>1||xt,De=[be?`${u}-divider-top`:"",ae||pt?`${u}-divider-bottom`:""].filter(Boolean).join(" "),_e=!n||i,He=()=>{if(!_e)return;const Me=pe??v;if(!P){k(at.length);return}k(Math.min(Me+P,at.length))},Ae=Me=>b.scalingValue(Me,n??!1),Be=le?I??0:Y??0,Ie=R??0,mt=x??0,ot=Math.max(Ie,ms),Ct=zc(0,Ye.length,be,ae,xt,w??0,n??!1).borderTopWidth,rt=le?"rowPaddingTopB":"rowPaddingTop",St=it[0],nt=it[it.length-1],Rt=et[0],ht=et[et.length-1],Gt=St&&Rt?Math.max(Rt.paddingLeft,po):0,Zt=nt&&ht?Math.max(ht.paddingRight,po):0,$e=ye,Ge=(Me,ct)=>y0(N,ve.current,fe?Me:null,ct),ft=(Me,ct)=>{if(!te)return;const dt=Me.image;if(!(dt!=null&&dt.assetId)){ie(()=>C(null));return}const kt=(X==null?void 0:X.min)??80,Ke=(X==null?void 0:X.max)??320,st=(me==null?void 0:me.rowId)===Me.id,It=st?me.widthPx:q0(kt,Ke),{x:At,y:ut}=Ge(ct,It);if(st&&fe){V(At,ut);return}C({rowId:Me.id,assetId:dt.assetId,objectFit:"contain",isVideo:p0(dt),embed:b.isEmbedMedia(dt)?dt:void 0,widthPx:It}),ue.current={x:At,y:ut}},Lt=Me=>{if(!te||!me||!fe)return;const{x:ct,y:dt}=Ge(Me,me.widthPx);V(ct,dt)},wt=()=>{me&&ie(()=>C(null))},vt=Me=>{H&&Oc(Me,u),!(!te||!me)&&ie(()=>C(null))},Nt=Me=>{H&&Dc(Me,u)};s.useLayoutEffect(()=>{if(!me||!ue.current)return;const{x:Me,y:ct}=ue.current;ue.current=null,we(Me,ct)},[me==null?void 0:me.rowId,me==null?void 0:me.assetId,we]),s.useLayoutEffect(()=>{if(!p||le){Ce(null);return}const Me=Fe.current,ct=Me==null?void 0:Me.parentElement;if(!Me||!ct){Ce(null);return}const dt=()=>{const Ke=Me.querySelector("[data-list-row]");if(!Ke){Ce(null);return}const st=ct.getBoundingClientRect(),It=Ke.getBoundingClientRect();Ce(It.top-st.top+It.height/2)};dt();const kt=new ResizeObserver(dt);return kt.observe(Me),kt.observe(ct),()=>kt.disconnect()},[p,le,Ye,Be,Ie,mt,t,e,it,Ze,Se,w,be,ae,xt]);const Wt=s.useMemo(()=>!le&&Dl.some(Me=>{const ct=Me.charAt(0),dt=e[`${Me}VerticalAlign`];return hp(dt,e,ct)}),[le,e,e.AColumnVerticalAlign,e.BColumnVerticalAlign,e.CColumnVerticalAlign,e.DColumnVerticalAlign,e.EColumnVerticalAlign]);s.useLayoutEffect(()=>{var At;const Me=ve.current;if(!Me)return;const ct=()=>{Me.querySelectorAll("[data-list-col]").forEach(ut=>{ut.style.transform="";const Xt=ut.querySelector(`.${u}-list-col`);Xt&&(Xt.style.minHeight="",Xt.style.height="");const Ut=ut.querySelector(`.${u}-list-col-title`);Ut&&(Ut.style.transform="")})};if(le||!Wt){ct();return}const dt=()=>{const ut=Array.from(Me.querySelectorAll("[data-list-row]")),Xt=`${u}-list-col`,Ut=`${u}-baseline-probe`;ut.forEach(Ot=>{Ot.querySelectorAll("[data-list-col]").forEach(Bt=>{Bt.style.transform="";const jt=Bt.querySelector(`.${Xt}`);jt&&(jt.style.minHeight="",jt.style.height="");const zt=Bt.querySelector(`.${u}-list-col-title`);zt&&(zt.style.transform="")})}),ut.forEach(Ot=>{const Bt=Array.from(Ot.querySelectorAll("[data-list-col]"));M0(Ot,Bt,Xt)}),Me.offsetHeight,ut.forEach(Ot=>{const Bt=Array.from(Ot.querySelectorAll("[data-list-col]")),jt=Ot.getBoundingClientRect().top,zt=new Map,Kt=Bt.map(Ne=>{const Oe=Ne.querySelector(`.${u}-list-col-title`),yt={el:Ne,titleEl:Oe,letter:Ne.getAttribute("data-col-letter")??"",kind:Ne.getAttribute("data-valign")??"top",anchor:Ne.getAttribute("data-valign-anchor")};return zt.set(yt.letter,yt),yt}),D=new Map,Le=(Ne,Oe)=>{const yt=D.get(Ne.letter);if(yt!==void 0)return yt;const Tt=Ne.anchor?zt.get(Ne.anchor):void 0;if(Ne.kind!=="baseline"||!Tt||Oe.has(Ne.letter)){const on=ps(Ne,jt,Xt,Ut);return D.set(Ne.letter,on),on}Oe.add(Ne.letter);const Je=Le(Tt,Oe);Oe.delete(Ne.letter);const Pt=ps(Ne,jt,Xt,Ut),$t=Je-Pt;E0(Ne.titleEl,$t);const _t=ps(Ne,jt,Xt,Ut);return D.set(Ne.letter,_t),_t};Kt.forEach(Ne=>Le(Ne,new Set))})};let kt=null;const Ke=()=>{kt===null&&(kt=requestAnimationFrame(()=>{kt=null,dt()}))};dt();const st=new ResizeObserver(()=>Ke());st.observe(Me);let It=!1;return typeof document<"u"&&((At=document.fonts)!=null&&At.ready)&&document.fonts.ready.then(()=>{It||Ke()}),()=>{It=!0,kt!==null&&(cancelAnimationFrame(kt),kt=null),st.disconnect(),ct()}},[Wt,le,e,t,Se,Ye,Ze]);const Dt=s.useMemo(()=>x0(u),[u]);return a.jsxs(a.Fragment,{children:[a.jsx("style",{dangerouslySetInnerHTML:{__html:Dt}}),a.jsx("div",{style:B,children:a.jsxs("div",{ref:ve,className:`${u}-wrapper ${ee}${De?` ${De}`:""}${le?` ${u}-type-b`:""}`.trim(),style:{width:b.scalingValue(m??0,n)},onMouseMove:te?Lt:void 0,onMouseLeave:te?wt:void 0,children:[a.jsxs("div",{style:{width:"100%",position:"relative"},children:[Ye.map((Me,ct)=>{var st,It,At;const dt=(((st=Me.link)==null?void 0:st.value.length)??0)>0,kt=dt&&(!n||i)?"a":"div",Ke=zc(ct,Ye.length,be,ae,xt,w??0,n??!1);return a.jsxs(kt,{ref:ct===0?ut=>{Fe.current=ut}:void 0,className:`${u}-list-item${dt||L==="always"?` ${u}-list-item-has-link`:""}${xt&&ct===Ye.length-1?` ${u}-list-item-before-cut`:""}`,...dt?{href:(It=Me.link)==null?void 0:It.value,target:((At=Me.link)==null?void 0:At.target)==="blank"?"_blank":"_self"}:{},style:Ke,onMouseEnter:ut=>{H&&(dt||L==="always")&&Oc(ut,u),te&&ft(Me,ut)},onMouseLeave:ut=>{H&&(dt||L==="always")&&Dc(ut,u)},children:[Be>0&&a.jsx("div",{className:`${u}-row-padding-handle`,style:{height:Ae(Be)}}),a.jsxs("div",{className:`${u}-list-cols-row${le?"":` ${u}-list-cols-row-h`}${p&&ct===0&&le?` ${u}-list-cols-row-controls`:""}`,...le?{}:{"data-list-row":""},style:le?void 0:{minHeight:Ae(mt)},children:[it.map((ut,Xt)=>{const Ut=Xt===it.length-1,Ot=et[Xt],Bt=ut.paddingBottom,jt=g0(Me.cells[ut.key]),zt=le&&jt&&Bt>0,Kt=le?{minHeight:Ae(mt)}:{width:Ae(Ze[Xt])},D=le?{paddingLeft:Ae(re),paddingRight:Ae(re)}:{paddingLeft:Ae(Ot.paddingLeft),paddingRight:Ae(Ot.paddingRight)},Le=ut.textPrefix.charAt(0),Ne=le?$0(e[`${ut.textPrefix}VerticalAlign`]):w0(e[`${ut.textPrefix}VerticalAlign`],e,Le),Oe=le&&jt&&p&&ct===0;return le&&!jt?null:a.jsxs("div",{className:le?`${u}-list-col-wrap`:void 0,...le?{}:{"data-list-col":"","data-col-letter":Le,"data-valign":Ne.kind,...Ne.kind==="baseline"?{"data-valign-anchor":Ne.anchorLetter}:{}},children:[a.jsx("div",{className:`${u}-list-col${Ut?` ${u}-list-col-last`:""}`,style:{...D,...Kt,...le?{justifyContent:Vc(Ne.kind)}:{}},"data-test":ut.width,children:a.jsx("span",{className:Xc(e,ut.textPrefix,`${u}-list-col-title`,`${u}-text-tight-leading`),style:{...Gc(Ca(e,ut.textPrefix),n),...Uc(e,ut.textPrefix,u,n),...le?{}:T0(Ne.kind)},children:Me.cells[ut.key]??null})}),zt&&a.jsx("div",{className:`${u}-row-padding-handle`,style:{height:Ae(Bt)}}),Oe&&a.jsx("div",{"data-controls":ut.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:`${u}-control-anchor`,style:{bottom:0,left:0,width:"100%",height:Ae(Math.max(Bt,ms))}})]},ut.key)}),p&&ct===0&&le&&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(z),"data-controls-center-only-drag":"","data-controls-hit-placement":"center",className:`${u}-control-anchor`,style:{top:0,left:0,width:Ae(he),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(z),"data-controls-center-only-drag":"","data-controls-hit-placement":"center",className:`${u}-control-anchor`,style:{top:0,left:Ae(Math.max(he,ye-he)),width:Ae(he),height:"100%"}})]})]}),!le&&Ie>0&&a.jsx("div",{className:`${u}-row-padding-handle`,style:{height:Ae(Ie)}}),p&&ct===0&&!le&&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:`${u}-control-anchor`,style:{bottom:0,left:0,width:"100%",height:Ae(ot)}})]},Me.id)}),p&&a.jsx("div",{style:{position:"absolute",inset:0,pointerEvents:"none"},children:a.jsx("div",{"data-controls":rt,"data-controls-axis":"y","data-controls-variant":"row-padding","data-controls-min":"0","data-controls-center-only-drag":"","data-controls-hit-placement":le?"center":"left-y",className:`${u}-control-anchor`,style:{top:Ct,left:0,width:"100%",height:Ae(Math.max(Be,ms))}})},"row-padding-handles"),p&&!le&&St&&nt&&a.jsxs("div",{style:{position:"absolute",inset:0,pointerEvents:"none"},children:[a.jsx("div",{"data-controls":St.paddingLeftKey,"data-controls-axis":"x","data-controls-variant":"column-padding","data-controls-min":"0","data-controls-max-fraction":String(Ze[0]-((Rt==null?void 0:Rt.paddingRight)??0)),"data-controls-center-only-drag":"","data-controls-hit-placement":"center-x","data-controls-hit-top":Ee??void 0,className:`${u}-control-anchor`,style:{top:0,left:0,width:Ae(Gt),height:"100%"}}),a.jsx("div",{"data-controls":nt.paddingRightKey,"data-controls-axis":"x","data-controls-variant":"column-padding","data-controls-reverse":"","data-controls-min":"0","data-controls-max-fraction":String(Ze[it.length-1]-((ht==null?void 0:ht.paddingLeft)??0)),"data-controls-center-only-drag":"","data-controls-hit-placement":"center-x","data-controls-hit-top":Ee??void 0,className:`${u}-control-anchor`,style:{top:0,left:Ae($e-Zt),width:Ae(Zt),height:"100%"}})]},"column-edge-padding-handles"),p&&!le&&it.slice(0,-1).map((Me,ct)=>{const dt=it[ct+1],kt=Ve.slice(0,ct+1).reduce((ut,Xt)=>ut+Xt,0),Ke=et[ct],st=et[ct+1],It=Math.max(Ke.paddingRight,po),At=Math.max(st.paddingLeft,po);return a.jsxs("div",{style:{position:"absolute",inset:0,pointerEvents:"none"},children:[a.jsx("div",{"data-controls":Me.paddingRightKey,"data-controls-axis":"x","data-controls-variant":"column-padding","data-controls-reverse":"","data-controls-min":"0","data-controls-max-fraction":String(Ze[ct]-Ke.paddingLeft),"data-controls-center-only-drag":"","data-controls-hit-placement":"center-x","data-controls-hit-top":Ee??void 0,className:`${u}-control-anchor`,style:{top:0,left:Ae(kt-It),width:Ae(It),height:"100%"}}),a.jsx("div",{"data-controls":dt.paddingLeftKey,"data-controls-axis":"x","data-controls-variant":"column-padding","data-controls-min":"0","data-controls-max-fraction":String(Ze[ct+1]-st.paddingRight),"data-controls-center-only-drag":"","data-controls-hit-placement":"center-x","data-controls-hit-top":Ee??void 0,className:`${u}-control-anchor`,style:{top:0,left:Ae(kt),width:Ae(At),height:"100%"}})]},`${Me.paddingRightKey}-padding`)}),p&&!le&&it.slice(0,-1).map((Me,ct)=>{const dt=U0(ct,Ve,Te,ye),Ke=Ve.slice(0,ct+1).reduce((st,It)=>st+It,0)-qc/2;return a.jsx("div",{style:{position:"absolute",inset:0,pointerEvents:"none"},children:a.jsx("div",{"data-controls":Me.widthKey,"data-controls-axis":"x","data-controls-min":String(Bl),"data-controls-max-fraction":String(dt),"data-controls-variant":"column-width",className:`${u}-col-resize-handle`,style:{position:"absolute",top:"0px",left:Ae(Ke),width:Ae(qc),height:"calc(100%)",pointerEvents:"auto"}})},`${Me.widthKey}-junction`)})]}),xt&&(()=>{const Me=Ca(e,si),ct=I0(e.cutLabelVerticalAlign),dt=Me.textTextAlign==="justify"||le;return a.jsx("button",{type:"button",className:`${u}-cut-item`,style:{minHeight:Ae(M??0),cursor:_e?"pointer":"default",...h0(ae,w??0,n??!1)},onClick:_e?He:void 0,onMouseEnter:H||te?vt:void 0,onMouseLeave:H?Nt:void 0,children:a.jsx("div",{className:`${u}-list-cols-row`,style:{...le?{paddingLeft:Ae(re),paddingRight:Ae(re)}:{},justifyContent:L0(Me.textTextAlign),alignItems:Vc(ct)},children:a.jsx("span",{className:Xc(e,si,`${u}-cut-label`,`${u}-text-tight-leading`),style:{...Gc(Me,n),...Uc(e,si,u,n),...dt?{width:"100%"}:{}},children:K})})})})(),te&&me&&typeof document<"u"&&(()=>{const Me=`${me.widthPx}px`,ct={width:Me,height:"auto",maxHeight:Me,objectFit:"contain"},dt=(c?document.getElementById(c):null)??document.body;return qn.createPortal(a.jsx("div",{ref:de,className:`${u}-hover-media-anchor`,"data-selection":"none",children:a.jsx(m0,{media:me,className:me.isVideo?`${u}-hover-video`:`${u}-hover-image`,style:ct},`${me.rowId}-${me.assetId}`)}),dt)})()]})})]})}const Z0=`import { useCallback, useEffect, useLayoutEffect, useMemo, useRef, useState, type CSSProperties } from 'react';
|
|
10663
|
+
`}const Ri=["AColumn","BColumnWidth","CColumnWidth","DColumnWidth","EColumnWidth"],Dl=["AColumn","BColumn","CColumn","DColumn","EColumn"],si="cutLabel",xr=[...Dl,si],ja=["A","B","C","D","E"];function mp(e){return`${e}ColumnVerticalAlign`}const Us=["Top","Center","Bottom"];function zl(e){const t=String(e??"Top").trim();if(t.toLowerCase().startsWith("baseline")){const i=t.slice(-1).toUpperCase();return ja.includes(i)?`Baseline ${i}`:"Top"}const n=t.toLowerCase();return n==="center"?"Center":n==="bottom"?"Bottom":n==="top"?"Top":t}function b0(e){const t=zl(e);return t.toLowerCase().startsWith("baseline")?!1:t==="Top"||t==="Center"||t==="Bottom"}function S0(e){const t=String(e??"").trim();if(!t.toLowerCase().startsWith("baseline"))return null;const n=t.slice(-1).toUpperCase();return ja.includes(n)?n:null}function gp(e,t,n){const i=S0(e);return i?i===t?!1:b0(n[mp(i)]):!0}function br(e){const t=zl(e);if(t.toLowerCase().startsWith("baseline")){const n=t.slice(-1).toUpperCase();return ja.includes(n)?{kind:"baseline",anchorLetter:n}:{kind:"top"}}return t==="Center"?{kind:"center"}:t==="Bottom"?{kind:"bottom"}:{kind:"top"}}function w0(e,t,n){if(hp(e,t,n))return br(e);const i=br(e);return i.kind==="baseline"?{kind:"top"}:i}function $0(e){const t=br(e);return t.kind==="baseline"?{kind:"top"}:t}function hp(e,t,n){return gp(e,n,t)?br(e).kind==="baseline":!1}function C0(e){const t={};let n=!1;for(const i of ja){const o=mp(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}gp(r,i,e)||(t[o]="Top",n=!0)}return n?t:null}function T0(e){return e==="center"?{flex:"0 0 auto",marginTop:"auto",marginBottom:"auto"}:e==="bottom"?{flex:"0 0 auto",marginTop:"auto"}:{}}function I0(e){const t=br(e).kind;return t==="baseline"?"center":t}function L0(e){return e==="right"?"flex-end":e==="center"?"center":"flex-start"}function Vc(e){return e==="center"?"center":e==="bottom"?"flex-end":"flex-start"}function P0(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 ps(e,t,n,i){const o=e.titleEl;if(!o)return 0;const r=o.closest(`.${n}`);if(!r)return 0;const l=P0(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 M0(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 E0(e,t){return!e||!t?(e&&(e.style.transform=""),0):(e.style.transform=`translateY(${t}px)`,t)}const R0={AColumn:"AColumn",BColumnWidth:"BColumn",CColumnWidth:"CColumn",DColumnWidth:"DColumn",EColumnWidth:"EColumn"};function Qt(e,t){return`${e}${t.replace(/^text/,"Text")}`}const k0={AColumn:"A",BColumn:"B",CColumn:"C",DColumn:"D",EColumn:"E",cutLabel:"CUT"};function A0(e){return[Qt(e,"textFontFamily"),Qt(e,"textFontSettings"),{type:"row",items:[Qt(e,"textFontSize"),Qt(e,"textLineHeight"),Qt(e,"textLetterSpacing"),Qt(e,"textWordSpacing")]},Qt(e,"textTextAlign"),Qt(e,"textTextAppearance"),`${e}VerticalAlign`]}function F0(){return{type:"tab",id:"listColumnTextStyle",tabs:Object.fromEntries(xr.map(e=>[k0[e],A0(e)]))}}function Ca(e,t){const n=i=>{const o=Qt(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===si?"center":"left"),textTextAppearance:n("textTextAppearance"),textColor:e.textColor}}function Gc(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 pn(nn(n,t))}function Xc(e,t,n,i){const o=Ca(e,t),r=o.textFontSize??.01,l=o.textLineHeight;return l!==void 0&&l<r?`${n} ${i}`:n}function Uc(e,t,n,i){const o=Ca(e,t),r=o.textFontSize??.01,l=o.textLineHeight;return l===void 0||l>=r?{}:{[`--${n}-title-leading-gap`]:b.scalingValue((r-l)/2,i)}}const Rn=["AColumnWidth","BColumnWidth","CColumnWidth","DColumnWidth","EColumnWidth"],Ro=["AColumnPaddingLeft","BColumnPaddingLeft","CColumnPaddingLeft","DColumnPaddingLeft","EColumnPaddingLeft"],ko=["AColumnPaddingRight","BColumnPaddingRight","CColumnPaddingRight","DColumnPaddingRight","EColumnPaddingRight"],Ao=["AColumnPaddingBottom","BColumnPaddingBottom","CColumnPaddingBottom","DColumnPaddingBottom","EColumnPaddingBottom"],N0={textColor:"text-color",backgroundColor:"background-color",dividerColor:"divider-color",textHoverColor:"text-hover-color",backgroundHoverColor:"background-hover-color",dividerHoverColor:"divider-hover-color"},_0=["hover","focus","filled","success","error"],qc=.004,po=.004,ms=po,Bl=50,Sr=1440,wr=Bl/Sr;function fp(e){const t=typeof e=="number"&&e>0?e:Sr;return Bl/t}function H0(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 Sr}const yp={AColumnWidth:.02,BColumnWidth:.02,CColumnWidth:.02,DColumnWidth:.02,EColumnWidth:.02};function lr(e){const t=typeof e.wrapperWidth=="number"?e.wrapperWidth:1;return Math.max(0,t)}function W0(e,t=1){const n=t/e;return Object.fromEntries(Rn.map(i=>[i,n]))}function O0(){return Object.fromEntries([...Ro.map(e=>[e,0]),...ko.map(e=>[e,0])])}function D0(){return Object.fromEntries(Ao.map(e=>[e,0]))}function Vr(e){return Object.fromEntries(Rn.map(t=>[t,typeof e[t]=="number"?e[t]:yp[t]]))}function vp(e,t,n){const i=e-wr,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 ga(e,t,n){const i=jl(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 z0(e,t,n){const i={};for(let o=0;o<e;o+=1){const r=Ro[o],l=ko[o],c=typeof n[r]=="number"?n[r]:0,d=typeof n[l]=="number"?n[l]:0,u=vp(t[o]??0,c,d);u.paddingLeft!==c&&(i[r]=u.paddingLeft),u.paddingRight!==d&&(i[l]=u.paddingRight)}return i}function jl(e,t,n){if(e<=0)return[];const i=Rn.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)+wr;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]-wr;if(p<=0)continue;const y=Math.min(d,p);c[u]-=y,d-=y}return[...c,i[e-1]]}function B0(e,t,n){if(e<=1)return{};const i=jl(e,t,n),o={};for(let r=0;r<e-1;r+=1){const l=Rn[r];i[r]!==n[l]&&(o[l]=i[r])}return o}function Kc(e){return Array.isArray(e.columnsOrder)&&e.columnsOrder.length>0?e.columnsOrder:[...Ri]}function j0(e,t){return e.length!==t.length?!1:e.every((n,i)=>n===t[i])}function V0(e,t,n,i){const o=Math.min(i,e.length,Rn.length),r={};for(let l=0;l<o;l+=1){const c=e[l],d=t.indexOf(c);if(d===-1)continue;const u=Rn[d],p=Ro[d],y=ko[d],S=Ao[d],m=Rn[l],h=Ro[l],x=ko[l],w=Ao[l],F=n[u],v=n[p],P=n[y],M=n[S];typeof F=="number"&&(r[m]=F),typeof v=="number"&&(r[h]=v),typeof P=="number"&&(r[x]=P),typeof M=="number"&&(r[w]=M)}return r}function xp(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 G0(e,t){const n=e.columns,i=t.columns;if(typeof n!="number"||n===i)return e;const o=lr(e),r=e.type==="b"||e.type===void 0&&t.type==="b",l={...e,...W0(n,o),...O0()};if(r)for(const c of Ao)typeof t[c]=="number"&&(l[c]=t[c]);else Object.assign(l,D0());return xp(e,l)?l:e}function X0(e,t,n){const i=C0(e);i&&(e={...e,...i});const o=fp(n==null?void 0:n.designWidth),r=e.columns,l=t.columns,c=lr(e),d=lr(t),u=e.type==="b"||e.type===void 0&&t.type==="b",p=typeof r=="number"?r:typeof l=="number"?l:Ri.length,y=P=>{if(u)return P;const M=Vr({...t,...P}),K=lr(P),X=ga(p,K,M),j=z0(p,X,{...t,...P});return Object.keys(j).length===0?P:{...P,...j}};if(typeof r=="number"&&r!==l)return e;const S=Kc(e),m=Kc(t);if(!j0(S,m))return y({...e,...V0(S,m,t,p)});if(c<d&&typeof p=="number"&&!u){const P=Vr({...t,...e});return y({...e,...B0(p,c,P)})}if(u){const P=typeof e.textPaddingLR=="number"?e.textPaddingLR:0,M=Math.max(0,(c-o)/2);return P>M?{...e,textPaddingLR:M}:e}const h=Vr({...t,...e}),x=ga(p,d,Vr(t)),F=ga(p,c,h).some((P,M)=>P<(x[M]??P)),v=Rn.some(P=>{const M=e[P],K=t[P];return typeof M=="number"&&typeof K=="number"&&M!==K});return F||v?y(e):e}function U0(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(wr,i-o-r-wr)}function q0(e,t){return Math.random()*(t-e)+e}function K0(e){return Object.fromEntries(Rn.map(t=>[t,typeof e[t]=="number"?e[t]:yp[t]]))}function gs(e,t,n=0){return Object.fromEntries(t.map(i=>[i,typeof e[i]=="number"?e[i]:n]))}function Y0(e,t,n,i,o,r){return e.slice(0,t).map((l,c)=>{const d=Ro[c],u=ko[c],p=Ao[c];return{key:l,textPrefix:R0[l],widthKey:Rn[c],width:n[Rn[c]],paddingLeftKey:d,paddingRightKey:u,paddingBottomKey:p,paddingLeft:i[d],paddingRight:o[u],paddingBottom:r[p]}})}function Q0({settings:e,content:t,isEditor:n,isPreviewMode:i,isEditMode:o,activeEvent:r,layoutId:l,portalId:c,onUpdateSettings:d}){const{prefix:u}=b.useScopedStyles(),p=!!o,{columns:y,type:S,wrapperWidth:m,entriesCount:h,cellMinHeight:x,dividerWidth:w,showVisibility:F,cut:v,showCut:P,cutCellMinHeight:M,cutLabel:K,imageSize:X,imageOnHover:j,imagePosition:N="cursor",imageInterpolation:_="on",entryHoverEffect:T,entryHoverShowOption:L,rowPaddingTop:Y,rowPaddingBottom:R,rowPaddingTopB:I,columnsOrder:$,textPaddingLR:G,textColor:O,backgroundColor:U,dividerColor:E,textHoverColor:f,backgroundHoverColor:Q,dividerHoverColor:q}=e,[pe,k]=s.useState(void 0),[me,C]=s.useState(null),ue=s.useRef(null),te=j==="on"&&(!n||i),fe=N==="cursor",Pe=fe&&_==="on",{anchorRef:de,onShow:we,onCursorMove:V,exit:ie}=v0(!!(te&&me!==null),Pe),oe=(v??0)>0,le=S==="b",ve=s.useRef(null),Fe=s.useRef(null),[Ee,Ce]=s.useState(null),[Se,g]=s.useState(Sr),Z=fp(Se),J=Math.max(0,((m??0)-Z)/2),re=Math.min(G??0,J),he=Math.max(re,po),z=((m??0)+Z)/2;s.useLayoutEffect(()=>{if(!n){g(Sr);return}const Me=()=>{g(H0(ve.current))};Me();const ct=ve.current;if(!ct)return;const dt=new ResizeObserver(Me);dt.observe(ct);let kt=ct;for(;kt&&!kt.style.getPropertyValue("--cntrl-article-width");)kt=kt.parentElement;return kt&&dt.observe(kt),()=>dt.disconnect()},[n,l]),s.useEffect(()=>{k(void 0)},[v,P,t,h]),s.useEffect(()=>{n&&!i&&k(void 0)},[n,i]);const B=b.buildColorVars(u,{textColor:O,backgroundColor:U,dividerColor:E,textHoverColor:f,backgroundHoverColor:Q,dividerHoverColor:q},N0,_0),ne=r&&r!=="default"?`${u}-state-${r}`:"",ee=`${!n||i?T==="default"?`${u}-entry-hover-default`:T==="blinds"?`${u}-entry-hover-blinds`:T==="reveal"?`${u}-entry-hover-reveal`:"":""} ${ne}`.trim(),H=T==="reveal"&&(!n||i),be=(F==null?void 0:F[0])??!1,ae=(F==null?void 0:F[1])??!1,W=s.useRef(e),ke=s.useRef(l);s.useEffect(()=>{if(!d||!n){W.current=e,ke.current=l;return}if(ke.current!==l){W.current=e,ke.current=l;return}const Me=W.current;if(!(Me!==e))return;if(typeof Me.columns=="number"&&typeof e.columns=="number"&&Me.columns!==e.columns){W.current=e;return}const dt=X0(e,Me,{designWidth:Se});W.current=e,xp(e,dt)&&d(dt)},[e,d,n,l,Se]);const ze=s.useMemo(()=>K0(e),[e.AColumnWidth,e.BColumnWidth,e.CColumnWidth,e.DColumnWidth,e.EColumnWidth]),Xe=s.useMemo(()=>gs(e,Ro),[e.AColumnPaddingLeft,e.BColumnPaddingLeft,e.CColumnPaddingLeft,e.DColumnPaddingLeft,e.EColumnPaddingLeft]),Ue=s.useMemo(()=>gs(e,ko),[e.AColumnPaddingRight,e.BColumnPaddingRight,e.CColumnPaddingRight,e.DColumnPaddingRight,e.EColumnPaddingRight]),Qe=s.useMemo(()=>gs(e,Ao),[e.AColumnPaddingBottom,e.BColumnPaddingBottom,e.CColumnPaddingBottom,e.DColumnPaddingBottom,e.EColumnPaddingBottom]),We=s.useMemo(()=>Array.isArray($)&&$.length>0?$:[...Ri],[$]),it=s.useMemo(()=>Y0(We,y,ze,Xe,Ue,Qe),[We,y,ze,Xe,Ue,Qe]),ye=lr(e),Te=s.useMemo(()=>Rn.slice(0,y).map(Me=>ze[Me]),[y,ze]),Ve=s.useMemo(()=>jl(y,ye,ze),[y,ye,ze]),Ze=s.useMemo(()=>ga(y,ye,ze),[y,ye,ze]),et=s.useMemo(()=>it.map((Me,ct)=>vp(Ze[ct]??0,Me.paddingLeft,Me.paddingRight)),[it,Ze]),at=s.useMemo(()=>{const Me=h===0?1/0:h;return(t??[]).slice(0,Me).map((dt,kt)=>({id:kt,cells:Object.fromEntries(Ri.map(Ke=>[Ke,dt[Ke]??""])),image:dt.image,link:dt.link}))},[t,h]),tt=oe?pe??v:at.length,Ye=s.useMemo(()=>oe?at.slice(0,tt):at,[at,oe,tt]),xt=oe&&tt<at.length,pt=Ye.length>1||xt,De=[be?`${u}-divider-top`:"",ae||pt?`${u}-divider-bottom`:""].filter(Boolean).join(" "),_e=!n||i,He=()=>{if(!_e)return;const Me=pe??v;if(!P){k(at.length);return}k(Math.min(Me+P,at.length))},Ae=Me=>b.scalingValue(Me,n??!1),Be=le?I??0:Y??0,Ie=R??0,mt=x??0,ot=Math.max(Ie,ms),Ct=zc(0,Ye.length,be,ae,xt,w??0,n??!1).borderTopWidth,rt=le?"rowPaddingTopB":"rowPaddingTop",St=it[0],nt=it[it.length-1],Rt=et[0],ht=et[et.length-1],Vt=St&&Rt?Math.max(Rt.paddingLeft,po):0,Zt=nt&&ht?Math.max(ht.paddingRight,po):0,$e=ye,Ge=(Me,ct)=>y0(N,ve.current,fe?Me:null,ct),ft=(Me,ct)=>{if(!te)return;const dt=Me.image;if(!(dt!=null&&dt.assetId)){ie(()=>C(null));return}const kt=(X==null?void 0:X.min)??80,Ke=(X==null?void 0:X.max)??320,st=(me==null?void 0:me.rowId)===Me.id,It=st?me.widthPx:q0(kt,Ke),{x:At,y:ut}=Ge(ct,It);if(st&&fe){V(At,ut);return}C({rowId:Me.id,assetId:dt.assetId,objectFit:"contain",isVideo:p0(dt),embed:b.isEmbedMedia(dt)?dt:void 0,widthPx:It}),ue.current={x:At,y:ut}},Lt=Me=>{if(!te||!me||!fe)return;const{x:ct,y:dt}=Ge(Me,me.widthPx);V(ct,dt)},wt=()=>{me&&ie(()=>C(null))},vt=Me=>{H&&Oc(Me,u),!(!te||!me)&&ie(()=>C(null))},Nt=Me=>{H&&Dc(Me,u)};s.useLayoutEffect(()=>{if(!me||!ue.current)return;const{x:Me,y:ct}=ue.current;ue.current=null,we(Me,ct)},[me==null?void 0:me.rowId,me==null?void 0:me.assetId,we]),s.useLayoutEffect(()=>{if(!p||le){Ce(null);return}const Me=Fe.current,ct=Me==null?void 0:Me.parentElement;if(!Me||!ct){Ce(null);return}const dt=()=>{const Ke=Me.querySelector("[data-list-row]");if(!Ke){Ce(null);return}const st=ct.getBoundingClientRect(),It=Ke.getBoundingClientRect();Ce(It.top-st.top+It.height/2)};dt();const kt=new ResizeObserver(dt);return kt.observe(Me),kt.observe(ct),()=>kt.disconnect()},[p,le,Ye,Be,Ie,mt,t,e,it,Ze,Se,w,be,ae,xt]);const Wt=s.useMemo(()=>!le&&Dl.some(Me=>{const ct=Me.charAt(0),dt=e[`${Me}VerticalAlign`];return hp(dt,e,ct)}),[le,e,e.AColumnVerticalAlign,e.BColumnVerticalAlign,e.CColumnVerticalAlign,e.DColumnVerticalAlign,e.EColumnVerticalAlign]);s.useLayoutEffect(()=>{var At;const Me=ve.current;if(!Me)return;const ct=()=>{Me.querySelectorAll("[data-list-col]").forEach(ut=>{ut.style.transform="";const Gt=ut.querySelector(`.${u}-list-col`);Gt&&(Gt.style.minHeight="",Gt.style.height="");const Ut=ut.querySelector(`.${u}-list-col-title`);Ut&&(Ut.style.transform="")})};if(le||!Wt){ct();return}const dt=()=>{const ut=Array.from(Me.querySelectorAll("[data-list-row]")),Gt=`${u}-list-col`,Ut=`${u}-baseline-probe`;ut.forEach(Ot=>{Ot.querySelectorAll("[data-list-col]").forEach(Bt=>{Bt.style.transform="";const Xt=Bt.querySelector(`.${Gt}`);Xt&&(Xt.style.minHeight="",Xt.style.height="");const zt=Bt.querySelector(`.${u}-list-col-title`);zt&&(zt.style.transform="")})}),ut.forEach(Ot=>{const Bt=Array.from(Ot.querySelectorAll("[data-list-col]"));M0(Ot,Bt,Gt)}),Me.offsetHeight,ut.forEach(Ot=>{const Bt=Array.from(Ot.querySelectorAll("[data-list-col]")),Xt=Ot.getBoundingClientRect().top,zt=new Map,Kt=Bt.map(Ne=>{const Oe=Ne.querySelector(`.${u}-list-col-title`),yt={el:Ne,titleEl:Oe,letter:Ne.getAttribute("data-col-letter")??"",kind:Ne.getAttribute("data-valign")??"top",anchor:Ne.getAttribute("data-valign-anchor")};return zt.set(yt.letter,yt),yt}),D=new Map,Le=(Ne,Oe)=>{const yt=D.get(Ne.letter);if(yt!==void 0)return yt;const Tt=Ne.anchor?zt.get(Ne.anchor):void 0;if(Ne.kind!=="baseline"||!Tt||Oe.has(Ne.letter)){const on=ps(Ne,Xt,Gt,Ut);return D.set(Ne.letter,on),on}Oe.add(Ne.letter);const Je=Le(Tt,Oe);Oe.delete(Ne.letter);const Pt=ps(Ne,Xt,Gt,Ut),$t=Je-Pt;E0(Ne.titleEl,$t);const _t=ps(Ne,Xt,Gt,Ut);return D.set(Ne.letter,_t),_t};Kt.forEach(Ne=>Le(Ne,new Set))})};let kt=null;const Ke=()=>{kt===null&&(kt=requestAnimationFrame(()=>{kt=null,dt()}))};dt();const st=new ResizeObserver(()=>Ke());st.observe(Me);let It=!1;return typeof document<"u"&&((At=document.fonts)!=null&&At.ready)&&document.fonts.ready.then(()=>{It||Ke()}),()=>{It=!0,kt!==null&&(cancelAnimationFrame(kt),kt=null),st.disconnect(),ct()}},[Wt,le,e,t,Se,Ye,Ze]);const Dt=s.useMemo(()=>x0(u),[u]);return a.jsxs(a.Fragment,{children:[a.jsx("style",{dangerouslySetInnerHTML:{__html:Dt}}),a.jsx("div",{style:B,children:a.jsxs("div",{ref:ve,className:`${u}-wrapper ${ee}${De?` ${De}`:""}${le?` ${u}-type-b`:""}`.trim(),style:{width:b.scalingValue(m??0,n)},onMouseMove:te?Lt:void 0,onMouseLeave:te?wt:void 0,children:[a.jsxs("div",{style:{width:"100%",position:"relative"},children:[Ye.map((Me,ct)=>{var st,It,At;const dt=(((st=Me.link)==null?void 0:st.value.length)??0)>0,kt=dt&&(!n||i)?"a":"div",Ke=zc(ct,Ye.length,be,ae,xt,w??0,n??!1);return a.jsxs(kt,{ref:ct===0?ut=>{Fe.current=ut}:void 0,className:`${u}-list-item${dt||L==="always"?` ${u}-list-item-has-link`:""}${xt&&ct===Ye.length-1?` ${u}-list-item-before-cut`:""}`,...dt?{href:(It=Me.link)==null?void 0:It.value,target:((At=Me.link)==null?void 0:At.target)==="blank"?"_blank":"_self"}:{},style:Ke,onMouseEnter:ut=>{H&&(dt||L==="always")&&Oc(ut,u),te&&ft(Me,ut)},onMouseLeave:ut=>{H&&(dt||L==="always")&&Dc(ut,u)},children:[Be>0&&a.jsx("div",{className:`${u}-row-padding-handle`,style:{height:Ae(Be)}}),a.jsxs("div",{className:`${u}-list-cols-row${le?"":` ${u}-list-cols-row-h`}${p&&ct===0&&le?` ${u}-list-cols-row-controls`:""}`,...le?{}:{"data-list-row":""},style:le?void 0:{minHeight:Ae(mt)},children:[it.map((ut,Gt)=>{const Ut=Gt===it.length-1,Ot=et[Gt],Bt=ut.paddingBottom,Xt=g0(Me.cells[ut.key]),zt=le&&Bt>0,Kt=le?{minHeight:Ae(mt)}:{width:Ae(Ze[Gt])},D=le?{paddingLeft:Ae(re),paddingRight:Ae(re)}:{paddingLeft:Ae(Ot.paddingLeft),paddingRight:Ae(Ot.paddingRight)},Le=ut.textPrefix.charAt(0),Ne=le?$0(e[`${ut.textPrefix}VerticalAlign`]):w0(e[`${ut.textPrefix}VerticalAlign`],e,Le),Oe=le&&p&&ct===0;return a.jsxs("div",{className:le?`${u}-list-col-wrap`:void 0,...le?{}:{"data-list-col":"","data-col-letter":Le,"data-valign":Ne.kind,...Ne.kind==="baseline"?{"data-valign-anchor":Ne.anchorLetter}:{}},children:[a.jsx("div",{className:`${u}-list-col${Ut?` ${u}-list-col-last`:""}`,style:{...D,...Kt,...le?{justifyContent:Vc(Ne.kind)}:{}},"data-test":ut.width,children:a.jsx("span",{className:Xc(e,ut.textPrefix,`${u}-list-col-title`,`${u}-text-tight-leading`),style:{...Gc(Ca(e,ut.textPrefix),n),...Uc(e,ut.textPrefix,u,n),...le?{}:T0(Ne.kind)},children:Xt?Me.cells[ut.key]??null:le?" ":null})}),zt&&a.jsx("div",{className:`${u}-row-padding-handle`,style:{height:Ae(Bt)}}),Oe&&a.jsx("div",{"data-controls":ut.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:`${u}-control-anchor`,style:{bottom:0,left:0,width:"100%",height:Ae(Math.max(Bt,ms))}})]},ut.key)}),p&&ct===0&&le&&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(z),"data-controls-center-only-drag":"","data-controls-hit-placement":"center",className:`${u}-control-anchor`,style:{top:0,left:0,width:Ae(he),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(z),"data-controls-center-only-drag":"","data-controls-hit-placement":"center",className:`${u}-control-anchor`,style:{top:0,left:Ae(Math.max(he,ye-he)),width:Ae(he),height:"100%"}})]})]}),!le&&Ie>0&&a.jsx("div",{className:`${u}-row-padding-handle`,style:{height:Ae(Ie)}}),p&&ct===0&&!le&&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:`${u}-control-anchor`,style:{bottom:0,left:0,width:"100%",height:Ae(ot)}})]},Me.id)}),p&&a.jsx("div",{style:{position:"absolute",inset:0,pointerEvents:"none"},children:a.jsx("div",{"data-controls":rt,"data-controls-axis":"y","data-controls-variant":"row-padding","data-controls-min":"0","data-controls-center-only-drag":"","data-controls-hit-placement":le?"center":"left-y",className:`${u}-control-anchor`,style:{top:Ct,left:0,width:"100%",height:Ae(Math.max(Be,ms))}})},"row-padding-handles"),p&&!le&&St&&nt&&a.jsxs("div",{style:{position:"absolute",inset:0,pointerEvents:"none"},children:[a.jsx("div",{"data-controls":St.paddingLeftKey,"data-controls-axis":"x","data-controls-variant":"column-padding","data-controls-min":"0","data-controls-max-fraction":String(Ze[0]-((Rt==null?void 0:Rt.paddingRight)??0)),"data-controls-center-only-drag":"","data-controls-hit-placement":"center-x","data-controls-hit-top":Ee??void 0,className:`${u}-control-anchor`,style:{top:0,left:0,width:Ae(Vt),height:"100%"}}),a.jsx("div",{"data-controls":nt.paddingRightKey,"data-controls-axis":"x","data-controls-variant":"column-padding","data-controls-reverse":"","data-controls-min":"0","data-controls-max-fraction":String(Ze[it.length-1]-((ht==null?void 0:ht.paddingLeft)??0)),"data-controls-center-only-drag":"","data-controls-hit-placement":"center-x","data-controls-hit-top":Ee??void 0,className:`${u}-control-anchor`,style:{top:0,left:Ae($e-Zt),width:Ae(Zt),height:"100%"}})]},"column-edge-padding-handles"),p&&!le&&it.slice(0,-1).map((Me,ct)=>{const dt=it[ct+1],kt=Ve.slice(0,ct+1).reduce((ut,Gt)=>ut+Gt,0),Ke=et[ct],st=et[ct+1],It=Math.max(Ke.paddingRight,po),At=Math.max(st.paddingLeft,po);return a.jsxs("div",{style:{position:"absolute",inset:0,pointerEvents:"none"},children:[a.jsx("div",{"data-controls":Me.paddingRightKey,"data-controls-axis":"x","data-controls-variant":"column-padding","data-controls-reverse":"","data-controls-min":"0","data-controls-max-fraction":String(Ze[ct]-Ke.paddingLeft),"data-controls-center-only-drag":"","data-controls-hit-placement":"center-x","data-controls-hit-top":Ee??void 0,className:`${u}-control-anchor`,style:{top:0,left:Ae(kt-It),width:Ae(It),height:"100%"}}),a.jsx("div",{"data-controls":dt.paddingLeftKey,"data-controls-axis":"x","data-controls-variant":"column-padding","data-controls-min":"0","data-controls-max-fraction":String(Ze[ct+1]-st.paddingRight),"data-controls-center-only-drag":"","data-controls-hit-placement":"center-x","data-controls-hit-top":Ee??void 0,className:`${u}-control-anchor`,style:{top:0,left:Ae(kt),width:Ae(At),height:"100%"}})]},`${Me.paddingRightKey}-padding`)}),p&&!le&&it.slice(0,-1).map((Me,ct)=>{const dt=U0(ct,Ve,Te,ye),Ke=Ve.slice(0,ct+1).reduce((st,It)=>st+It,0)-qc/2;return a.jsx("div",{style:{position:"absolute",inset:0,pointerEvents:"none"},children:a.jsx("div",{"data-controls":Me.widthKey,"data-controls-axis":"x","data-controls-min":String(Bl),"data-controls-max-fraction":String(dt),"data-controls-variant":"column-width",className:`${u}-col-resize-handle`,style:{position:"absolute",top:"0px",left:Ae(Ke),width:Ae(qc),height:"calc(100%)",pointerEvents:"auto"}})},`${Me.widthKey}-junction`)})]}),xt&&(()=>{const Me=Ca(e,si),ct=I0(e.cutLabelVerticalAlign),dt=Me.textTextAlign==="justify"||le;return a.jsx("button",{type:"button",className:`${u}-cut-item`,style:{minHeight:Ae(M??0),cursor:_e?"pointer":"default",...h0(ae,w??0,n??!1)},onClick:_e?He:void 0,onMouseEnter:H||te?vt:void 0,onMouseLeave:H?Nt:void 0,children:a.jsx("div",{className:`${u}-list-cols-row`,style:{...le?{paddingLeft:Ae(re),paddingRight:Ae(re)}:{},justifyContent:L0(Me.textTextAlign),alignItems:Vc(ct)},children:a.jsx("span",{className:Xc(e,si,`${u}-cut-label`,`${u}-text-tight-leading`),style:{...Gc(Me,n),...Uc(e,si,u,n),...dt?{width:"100%"}:{}},children:K})})})})(),te&&me&&typeof document<"u"&&(()=>{const Me=`${me.widthPx}px`,ct={width:Me,height:"auto",maxHeight:Me,objectFit:"contain"},dt=(c?document.getElementById(c):null)??document.body;return qn.createPortal(a.jsx("div",{ref:de,className:`${u}-hover-media-anchor`,"data-selection":"none",children:a.jsx(m0,{media:me,className:me.isVideo?`${u}-hover-video`:`${u}-hover-image`,style:ct},`${me.rowId}-${me.assetId}`)}),dt)})()]})})]})}const Z0=`import { useCallback, useEffect, useLayoutEffect, useMemo, useRef, useState, type CSSProperties } from 'react';
|
|
10664
10664
|
import { createPortal } from 'react-dom';
|
|
10665
10665
|
import { CommonComponentProps } from '../props';
|
|
10666
10666
|
import { buildColorVars, EmbedMediaFrame, isEmbedMedia, scalingValue, useScopedStyles, type ContentLink } from '../utils/index';
|
|
@@ -13367,7 +13367,6 @@ export function List({ settings, content, isEditor, isPreviewMode, isEditMode, a
|
|
|
13367
13367
|
const columnPaddingBottom = col.paddingBottom;
|
|
13368
13368
|
const hasColumnText = hasListColumnText(row.cells[col.key]);
|
|
13369
13369
|
const showColumnPaddingBottom = isVerticalLayout
|
|
13370
|
-
&& hasColumnText
|
|
13371
13370
|
&& columnPaddingBottom > 0;
|
|
13372
13371
|
const columnSizeStyle = isVerticalLayout
|
|
13373
13372
|
? { minHeight: scaled(resolvedCellMinHeight) }
|
|
@@ -13393,14 +13392,9 @@ export function List({ settings, content, isEditor, isPreviewMode, isEditMode, a
|
|
|
13393
13392
|
);
|
|
13394
13393
|
|
|
13395
13394
|
const columnPaddingBottomOverlay = isVerticalLayout
|
|
13396
|
-
&& hasColumnText
|
|
13397
13395
|
&& showControls
|
|
13398
13396
|
&& rowIdx === 0;
|
|
13399
13397
|
|
|
13400
|
-
if (isVerticalLayout && !hasColumnText) {
|
|
13401
|
-
return null;
|
|
13402
|
-
}
|
|
13403
|
-
|
|
13404
13398
|
return (
|
|
13405
13399
|
<div
|
|
13406
13400
|
key={col.key}
|
|
@@ -13440,7 +13434,9 @@ export function List({ settings, content, isEditor, isPreviewMode, isEditMode, a
|
|
|
13440
13434
|
...(!isVerticalLayout ? vAlignToTitleStyle(vAlign.kind) : {}),
|
|
13441
13435
|
}}
|
|
13442
13436
|
>
|
|
13443
|
-
{
|
|
13437
|
+
{hasColumnText
|
|
13438
|
+
? (row.cells[col.key] ?? null)
|
|
13439
|
+
: (isVerticalLayout ? '\\u00a0' : null)}
|
|
13444
13440
|
</span>
|
|
13445
13441
|
</div>
|
|
13446
13442
|
{showColumnPaddingBottom && (
|
|
@@ -14682,7 +14678,7 @@ export function FAQ({ settings, content, isEditor, isPreviewMode, isEditMode, ac
|
|
|
14682
14678
|
</>
|
|
14683
14679
|
);
|
|
14684
14680
|
}
|
|
14685
|
-
`;function yi(e){return{type:"number",scope:"layout",title:e,min:0,max:100,display:{type:"range-control"}}}const id={fontSettings:{type:"object",display:{type:"font-settings-weight"},properties:{fontWeight:{type:"number"},fontStyle:{type:"string"}}}},$x=["questionColor","answerColor","dividerColor","iconColor","questionHoverColor","iconHoverColor","iconActiveColor","dividerHoverColor"],Cx={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:yi("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:{...id.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:{...id.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:yi("Question Padding Left"),questionPaddingTop:yi("Question Padding Top"),questionPaddingBottom:yi("Question Padding Bottom"),answerPaddingLeft:yi("Answer Padding Left"),answerPaddingRight:yi("Answer Padding Right"),answerPaddingTop:yi("Answer Padding Top"),answerPaddingBottom:yi("Answer Padding Bottom")},defaults:{dividerStyle:"dotted",entryHoverEffect:"default",autoclose:"off",icon:"01M3QM74XGFBPMXNEQB1BXSD9E",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:[...$x],panelIds:["general","typeStyle"],stateItems:{default:["questionColor","answerColor","dividerColor","iconColor","questionHoverColor","dividerHoverColor","iconHoverColor","iconActiveColor"]}}},Tx={element:Sx,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:Cx,sourceCode:wx},li=e=>e.display==="cover",Va=e=>{const t=e.ratioValue??"1:1",n=e.reversed??!1,[i,o]=t.split(":").map(Number);return`${n?o:i} / ${n?i:o}`},od=100,Ix=.2,rd=8,Sp=({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"?od:Math.max(od,window.innerHeight*Ix),[]),y=s.useCallback(T=>Math.max(0,1-T/(p*1.5)),[p]),S=s.useCallback(T=>Math.max(0,1-T/(p*.45)),[p]),m=s.useCallback(T=>{const L=typeof window<"u"?window.innerHeight:800,Y=Math.max(.88,1-T/L*.12);return`translateY(${T}px) scale(${Y})`},[]),h=s.useCallback(()=>{d.current=null},[]),x=s.useCallback(()=>{c(!0),r(0),window.setTimeout(()=>c(!1),n),h()},[n,h]),w=s.useCallback(()=>{const T=typeof window<"u"?window.innerHeight:800;c(!0),r(T),window.setTimeout(()=>{t(),h(),c(!1)},Math.min(n,200))},[n,t,h]),F=s.useCallback(T=>{!e||l||T.pointerType==="touch"&&(i!=null&&i(T.target)||(d.current={startX:T.clientX,startY:T.clientY,isLocked:null,pointerId:T.pointerId}))},[e,l,i]),v=s.useCallback(T=>{const L=d.current;if(!e||!L||T.pointerType!=="touch"||L.pointerId!==T.pointerId)return;const Y=T.clientX-L.startX,R=T.clientY-L.startY;if(L.isLocked===null){if(Math.abs(Y)<rd&&Math.abs(R)<rd)return;if(R>0&&R>Math.abs(Y))L.isLocked=!0,T.currentTarget.setPointerCapture(T.pointerId);else{L.isLocked=!1,h();return}}if(!L.isLocked)return;T.preventDefault();const I=Math.max(0,R);u.current=I,r(I)},[e,h]),P=s.useCallback(T=>{const L=d.current;if(!e||!L||T.pointerType!=="touch"||L.pointerId!==T.pointerId)return;const Y=L.isLocked===!0;if(T.currentTarget.hasPointerCapture(T.pointerId)&&T.currentTarget.releasePointerCapture(T.pointerId),!Y){h();return}T.clientY-L.startY>=p?w():x()},[p,w,e,h,x]),M=s.useCallback(T=>{P(T)},[P]),K=s.useCallback(T=>{P(T)},[P]),X=o>0,j=l?`transform ${n}ms ease`:"none",N=l?`opacity ${n}ms ease`:"none",_=o>0||l;return{isSwipeDragging:X,backdropStyle:{opacity:y(o),transition:N},mediaAreaStyle:{transform:m(o),transition:j,touchAction:X?"none":void 0,willChange:X?"transform":void 0},overlayContentStyle:_?{opacity:S(o),transition:N}:void 0,swipeHandlers:e?{onPointerDown:F,onPointerMove:v,onPointerUp:M,onPointerCancel:K}:{},dismissAreaStyle:e?{touchAction:X?"none":"pan-x"}:void 0}},Lx="[data-lightbox-scrollable]",Vl=(e=!0)=>{s.useEffect(()=>{if(!e)return;const t=window.scrollY,n=document.body.style.overflow,i=document.body.style.position,o=document.body.style.top,r=document.body.style.width,l=document.documentElement.style.overflow;document.body.style.overflow="hidden",document.body.style.position="fixed",document.body.style.top=`-${t}px`,document.body.style.width="100%",document.documentElement.style.overflow="hidden";const c=d=>{const u=d.target;u instanceof Element&&u.closest(Lx)||d.preventDefault()};return document.addEventListener("touchmove",c,{passive:!1}),()=>{document.removeEventListener("touchmove",c),document.body.style.overflow=n,document.body.style.position=i,document.body.style.top=o,document.body.style.width=r,document.documentElement.style.overflow=l,window.scrollTo({top:t,left:0,behavior:"instant"})}},[e])},Px=(e,t,n,i)=>{const o=Math.min(Math.abs(e)/Math.max(i,1),1);return t+(n-t)*o},Mx=e=>{e.style.transition="",e.style.transform="",e.style.willChange=""},Ex=e=>{const t=getComputedStyle(e).transform;return t==="none"?0:new DOMMatrixReadOnly(t).m41},Rx=(e,t,n,{duration:i,easing:o,onComplete:r})=>{const l=e.scrollLeft,c=n-l,d=l-n,u=(h,x)=>{Mx(t),e.scrollLeft=h,x&&(r==null||r())};if(Math.abs(c)<.5)return u(n,!0),()=>{};let p=!1,y=0;const S=()=>{t.removeEventListener("transitionend",m),clearTimeout(y)},m=h=>{h.target!==t||h.propertyName!=="transform"||p||(p=!0,S(),u(n,!0))};return t.addEventListener("transitionend",m),t.style.willChange="transform",t.style.transition="none",t.style.transform="translate3d(0, 0, 0)",t.offsetHeight,t.style.transition=`transform ${i}ms ${o}`,t.style.transform=`translate3d(${d}px, 0, 0)`,y=window.setTimeout(()=>{p||(p=!0,S(),u(n,!0))},i+64),()=>{p||(p=!0,S(),u(l-Ex(t),!1))}},cr=300,kx=900,Ax=1500,Fx="cubic-bezier(0.16, 1, 0.3, 1)",Nx=3e3,_x=2,Hx=16,Wx=.05,Ox=1,Xr=.3,Dx=50,zx=20,ro=.004,Fo=["title1","title2","title3"],Bx={title1:"1",title2:"2",title3:"3"},jx={title1:"title1Color",title2:"title2Color",title3:"title3Color"},Vx={title1:.02,title2:.02,title3:.02},Ur=e=>`max(${e}, ${zx}px)`,Gx=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]}},Xx=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=Gx(e.text);return{title1:t.title1??"",title2:t.title2??"",title3:t.title3??""}},Jt=(e,t)=>`${e}${t.charAt(0).toUpperCase()}${t.slice(1)}`,Ux=e=>[Jt(e,"fontFamily"),Jt(e,"fontSettings"),{type:"row",items:[Jt(e,"fontSize"),Jt(e,"lineHeight"),Jt(e,"letterSpacing"),Jt(e,"wordSpacing")]},Jt(e,"textAlign"),Jt(e,"textAppearance")],qx=()=>({type:"tab",id:"stripTextStyle",tabs:Object.fromEntries(Fo.map(e=>[Bx[e],Ux(e)]))}),Gl=(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},wp=(e,t)=>Gl(e,t),qr=(e,t)=>{const n=t.filter((i,o)=>o!==e).reduce((i,o)=>i+o,0);return Math.max(1-n,0)},ad=(e,t)=>{const n=e.map(i=>t[i.widthKey]??0);return{resolved:Gl(e.length,n),effective:wp(e.length,n)}},Kx=(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},hs=(e,t)=>{const n=i=>{const o=Jt(t,i);return e[o]};return{fontFamily:n("fontFamily")??"Arial",fontSettings:n("fontSettings")??{fontWeight:400,fontStyle:"normal"},fontSize:n("fontSize"),lineHeight:n("lineHeight"),letterSpacing:n("letterSpacing")??0,wordSpacing:n("wordSpacing")??0,textAlign:n("textAlign")??"left",textAppearance:n("textAppearance"),color:e[jx[t]]}},Yx=(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),fs=(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??Vx[e],lineHeight:t.lineHeight,letterSpacing:t.letterSpacing,wordSpacing:t.wordSpacing,textAlign:t.textAlign,textAppearance:t.textAppearance,color:t.color??"#ffffff"};return nn(i,n)},Qx=({prefix:e,images:t,settings:n,isEditor:i,isEditMode:o,isPreviewMode:r,onClose:l})=>{const{backgroundColor:c,thumbnailSize:d,thumbnailGap:u,thumbnailMarginBottom:p,imageGap:y,closeIcon:S,closeIconMaxWidth:m,closeIconColor:h,closeIconHoverColor:x,thumbnailTrigger:w,thumbnailVisibility:F,thumbnailObjectFit:v,thumbnailActive:P,thumbnailActiveColor:M,title1Width:K,title2Width:X,title3Width:j,title1MarginLeft:N=0,title2MarginLeft:_=0,title3MarginLeft:T=0,titleRowMarginBottom:L=0,titleHeaderLayout:Y="desktop",contentMarginTop:R,iconMarginLeft:I}=n,$=A=>b.scalingValue(A,i??!1),G=d??n.thumnailSize??.03,O=$(G),U=$(u),E=$(p??.02),f=$(y??0),Q=$(R??0),q=Ur(Q),pe=$(I??0),[k,me]=s.useState(0),C=s.useRef(k);C.current=k;const ue=t[k],{title1:te,title2:fe,title3:Pe}=Xx(ue),de=fs("title1",hs(n,"title1"),i),we=fs("title2",hs(n,"title2"),i),V=fs("title3",hs(n,"title3"),i),ie=Y==="mobile",oe=!o&&(!i||r),le=oe,ve=oe,Fe=oe,Ee=li(v),Ce=Ee?{"--image-aspect-ratio":Va(v)}:void 0,Se=!!(te||fe||Pe),g=s.useMemo(()=>Kx(e,te,fe,Pe,de,we,V),[e,k,te,fe,Pe,de,we,V]),Z=s.useMemo(()=>({title1Width:K,title2Width:X,title3Width:j}),[K,X,j]),J=s.useMemo(()=>g.map(A=>Z[A.widthKey]),[g,Z]),re=s.useMemo(()=>Gl(g.length,J),[g.length,J]),he=s.useMemo(()=>wp(g.length,J),[g.length,J]),z=s.useMemo(()=>g.filter(A=>A.prefix==="title1"),[g]),B=s.useMemo(()=>g.filter(A=>A.prefix==="title2"||A.prefix==="title3"),[g]),ne=s.useMemo(()=>ad(z,Z),[z,Z]),ce=s.useMemo(()=>ad(B,Z),[B,Z]),ee=s.useCallback((A,se)=>{const ge=g.indexOf(A);if(!ie||se==="single-row")return{effectiveWidth:he[ge]??0,resolvedWidth:re[ge]??0,maxWidth:qr(ge,re)};if(se==="two-row-top"){const je=z.indexOf(A);return{effectiveWidth:ne.effective[je]??0,resolvedWidth:ne.resolved[je]??0,maxWidth:qr(je,ne.resolved)}}const Re=B.indexOf(A);return{effectiveWidth:ce.effective[Re]??0,resolvedWidth:ce.resolved[Re]??0,maxWidth:qr(Re,ce.resolved)}},[B,ce,he,re,g,z,ne,ie]),H=s.useCallback(A=>b.scalingValue(A,i??!1),[i]),be=H(L??0),ae=s.useMemo(()=>({title1MarginLeft:N,title2MarginLeft:_,title3MarginLeft:T}),[N,_,T]),W=s.useCallback(A=>g.slice(0,A+1).reduce((se,ge,Re)=>se+(ge!=null&&ge.marginLeftKey?ae[ge.marginLeftKey]??0:0)+(re[Re]??0),0)+(ie?0:N??0),[g,ae,re,ie,N]),ke=s.useCallback(()=>ie?0:N??0,[ie,N]),ze=s.useCallback(A=>B.slice(0,A).reduce((se,ge,Re)=>se+(ge.marginLeftKey?ae[ge.marginLeftKey]??0:0)+(ce.resolved[Re]??0),0),[B,ce.resolved,ae]),Xe=s.useCallback(A=>{const se=B[A];return ze(A)+(se.marginLeftKey?ae[se.marginLeftKey]??0:0)+(ce.resolved[A]??0)},[B,ce.resolved,ze,ae]),Ue=(A,se)=>{const ge=A.marginLeftKey?ae[A.marginLeftKey]??0:0,{effectiveWidth:Re,resolvedWidth:je,maxWidth:gt}=ee(A,se),Ht=o&&se==="two-row-top";return a.jsxs("div",{className:`${e}-title-cell`,"data-title":A.prefix,style:{...se==="single-row"?{gridArea:A.prefix}:{},width:H(Re),...ge>0?{marginLeft:H(ge)}:{}},children:[a.jsx("p",{className:A.className,style:A.style,children:A.text}),Ht&&A.marginLeftKey&&a.jsx("div",{"data-controls":A.marginLeftKey,"data-controls-axis":"x","data-controls-min":"0","data-controls-max-fraction":String(je),style:{position:"absolute",top:0,left:H(-ge),width:`max(${H(ge)}, 10px)`,height:"100%",pointerEvents:"auto"}}),Ht&&a.jsx("div",{"data-controls":A.widthKey,"data-controls-axis":"x","data-controls-max-fraction":String(gt),"data-controls-variant":"column-width",className:`${e}-title-resize-handle`,style:{position:"absolute",top:0,right:H(-ro/2),width:H(ro),height:"100%",pointerEvents:"auto"}})]},A.className)},Qe=()=>{const A=ie?-1:g.findIndex(Re=>Re.prefix==="title1"),se=!ie&&(o||(N??0)>0)?(()=>{const Re=N??0,je=A>=0?re[A]:K??0;return a.jsx("div",{"data-controls":"title1MarginLeft","data-controls-axis":"x","data-controls-min":"0","data-controls-max-fraction":String(je),style:{position:"absolute",top:0,left:0,width:`max(${H(Re)}, 10px)`,height:"100%",pointerEvents:"auto"}},"title1MarginLeft")})():null,ge=g.flatMap((Re,je)=>{if(!Re.marginLeftKey)return[];const gt=ae[Re.marginLeftKey]??0,Ht=Yx(g,re,ae,je)+ke();return a.jsx("div",{"data-controls":Re.marginLeftKey,"data-controls-axis":"x","data-controls-min":"0","data-controls-max-fraction":String(re[je]),style:{position:"absolute",top:0,left:H(Ht),width:`max(${H(gt)}, 10px)`,height:"100%",pointerEvents:"auto"}},Re.marginLeftKey)});return se?[se,...ge]:ge},We=()=>g.map((A,se)=>{const ge=qr(se,re),je=W(se)-ro/2;return a.jsx("div",{style:{position:"absolute",inset:0,pointerEvents:"none"},children:a.jsx("div",{"data-controls":A.widthKey,"data-controls-axis":"x","data-controls-max-fraction":String(ge),"data-controls-variant":"column-width",className:`${e}-title-resize-handle`,style:{position:"absolute",top:0,left:H(je),width:H(ro),height:"100%",pointerEvents:"auto"}})},`${A.widthKey}-junction`)}),it=()=>B.flatMap((A,se)=>{if(!A.marginLeftKey)return[];const ge=ae[A.marginLeftKey]??0,Re=ze(se),{resolvedWidth:je}=ee(A,"two-row-bottom");return a.jsx("div",{"data-controls":A.marginLeftKey,"data-controls-axis":"x","data-controls-min":"0","data-controls-max-fraction":String(je),style:{position:"absolute",top:0,left:H(Re),width:`max(${H(ge)}, 10px)`,height:"100%",pointerEvents:"auto"}},A.marginLeftKey)}),ye=()=>B.map((A,se)=>{const{maxWidth:ge}=ee(A,"two-row-bottom"),je=Xe(se)-ro/2;return a.jsx("div",{style:{position:"absolute",inset:0,pointerEvents:"none"},children:a.jsx("div",{"data-controls":A.widthKey,"data-controls-axis":"x","data-controls-max-fraction":String(ge),"data-controls-variant":"column-width",className:`${e}-title-resize-handle`,style:{position:"absolute",top:0,left:H(je),width:H(ro),height:"100%",pointerEvents:"auto"}})},`${A.widthKey}-junction`)}),Te=s.useRef(null),Ve=s.useRef(null),Ze=s.useRef(null),et=s.useRef(null),at=s.useRef([]),tt=s.useRef([]),Ye=s.useRef(0),xt=s.useRef(null),pt=s.useRef({isActive:!1,startX:0,scrollLeft:0,startActiveIndex:0,hasMoved:!1}),De=s.useRef(null),_e=s.useRef(null),He=s.useRef(0),Ae=s.useRef("forward"),Be=s.useRef(0),Ie=s.useRef(null),mt=s.useRef(!1),ot=t.length>1&&(!o||!!r),Ct=ot?3:1,rt=s.useMemo(()=>Array.from({length:Ct},()=>t).flat(),[t,Ct]),[St,nt]=s.useState(!1),[Rt,ht]=s.useState(!1),[Gt,Zt]=s.useState(!0),$e=s.useRef(null),Ge=s.useRef(null),ft=s.useRef(!1),Lt=s.useRef(!1),wt=s.useRef(null),vt=s.useRef(null),Nt=le&&!Gt,Wt=s.useCallback(()=>{le&&(Zt(!0),vt.current&&clearTimeout(vt.current),vt.current=setTimeout(()=>{pt.current.isActive||Zt(!1)},Nx))},[le]),Dt=s.useCallback(()=>{o||Lt.current||(Lt.current=!0,ht(!1),wt.current=setTimeout(()=>{l()},cr))},[o,l]),Me=()=>a.jsxs("div",{className:`${e}-close-icon`,"data-overlay-content-hidden":Nt?"true":"false",style:{width:b.scalingValue(m??0,i),height:b.scalingValue(m??0,i),marginRight:pe,"--close-icon-hover-color":x},children:[a.jsx("button",{type:"button",className:`${e}-close-icon-inner`,onClick:Dt,"aria-label":"Close",children:a.jsx(mn,{url:S,fill:h,hoverFill:i&&!r?h:x,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:pe,height:"100%",pointerEvents:"auto"}})]}),ct=(A="two-row")=>a.jsx("div",{...A==="two-row"&&o?{"data-controls":"title1MarginLeft","data-controls-axis":"x"}:{},style:{width:H(N??0),flexShrink:0,...A==="single-row"?{gridArea:"margin"}:{alignSelf:"stretch"},...A==="two-row"&&o?{pointerEvents:"auto"}:{}}}),dt=()=>{const A=g.find(Re=>Re.prefix==="title1"),se=g.filter(Re=>Re.prefix==="title2"||Re.prefix==="title3"),ge=se.length>0||o||(L??0)>0;return a.jsxs(a.Fragment,{children:[a.jsxs("div",{className:`${e}-header-row-top`,children:[(N??0)>0||o?ct():null,A&&Ue(A,"two-row-top"),S&&Me()]}),ge?a.jsxs("div",{className:`${e}-header-row-bottom-wrap`,children:[se.length>0?a.jsxs("div",{className:`${e}-header-row-bottom`,children:[se.map(Re=>Ue(Re,"two-row-bottom")),o&&a.jsxs(a.Fragment,{children:[it(),ye()]})]}):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:be,width:"100%",flexShrink:0,pointerEvents:o?"auto":"none"}})]}):null]})},kt=()=>a.jsxs(a.Fragment,{children:[(N??0)>0||o?ct("single-row"):null,g.map(A=>Ue(A,"single-row")),o?a.jsxs(a.Fragment,{children:[Qe(),We()]}):null,S?Me():null]}),Ke=s.useCallback(A=>!!(A.closest("[data-controls]")||A.closest(`.${e}-thumbnails`)||A.closest(`.${e}-close-icon`)),[e]),{isSwipeDragging:st,backdropStyle:It,mediaAreaStyle:At,overlayContentStyle:ut,swipeHandlers:Xt,dismissAreaStyle:Ut}=Sp({enabled:oe??!1,onClose:Dt,animMs:cr,isBlockedTarget:Ke}),Ot=()=>{if(!ot||t.length===0)return Ye.current=0,0;const A=tt.current[0],se=tt.current[t.length];if(!A||!se)return Ye.current;const ge=se.offsetLeft-A.offsetLeft;return ge>0&&(Ye.current=ge),Ye.current},Bt=(A=!1)=>{if(!ot)return;const se=Ve.current,ge=Ot();!se||ge<=0||ge<se.clientWidth*.25||(se.scrollLeft<=0?(se.scrollLeft+=ge,A&&(pt.current.scrollLeft+=ge),mt.current&&(Be.current+=ge)):se.scrollLeft>=ge*2&&(se.scrollLeft-=ge,A&&(pt.current.scrollLeft-=ge),mt.current&&(Be.current-=ge)))},jt=(A,se=(ge=>(ge=Ve.current)==null?void 0:ge.scrollLeft)()??0)=>{if(!ot)return A;let Re=t.length+A,je=1/0;for(let gt=0;gt<Ct;gt++){const Ht=gt*t.length+A,qt=tt.current[Ht];if(!qt)continue;const sn=Math.abs(qt.offsetLeft-se);sn<je&&(je=sn,Re=Ht)}return Re},zt=A=>{const se=Ve.current;return!A||!se?!1:A.offsetWidth>se.clientWidth+1},Kt=A=>{const se=Ve.current;if(!A||!se||!zt(A))return!1;const ge=A.offsetLeft,Re=ge+A.offsetWidth;return se.scrollLeft>=ge-1&&se.scrollLeft+se.clientWidth<=Re+1},D=(A=(se=>(se=Ve.current)==null?void 0:se.scrollLeft)()??0)=>{for(let Re=0;Re<tt.current.length;Re+=1){const je=tt.current[Re];if(je&&Kt(je))return Re}let ge={flatIndex:0,distance:1/0};return tt.current.forEach((Re,je)=>{if(!Re)return;const gt=Math.abs(Re.offsetLeft-A);gt<ge.distance&&(ge={flatIndex:je,distance:gt})}),ge.flatIndex},Le=A=>{Ve.current&&tt.current.forEach(se=>{se&&(se.style.scrollSnapAlign=zt(se)&&A==="backward"?"end":"start")})},Ne=(A,se,ge)=>{const Re=A-se,je=D(se),gt=tt.current[je];if(Kt(gt))return D(A)%t.length;const Ht=tt.current[je+1],qt=gt?Ht?Ht.offsetLeft-gt.offsetLeft:gt.offsetWidth:0,sn=qt>0?Re>qt*Xr?1:Re<-qt*Xr?-1:0:0;return sn===0?ge:ot?(ge+sn+t.length)%t.length:Math.max(0,Math.min(t.length-1,ge+sn))},Oe=s.useCallback((A=!1)=>{if(F!=="on"||o)return;const se=et.current,ge=C.current,Re=at.current[ge];if(!se||!Re||se.scrollWidth<=se.clientWidth)return;const je=se.scrollLeft,gt=je+se.clientWidth,Ht=Re.offsetLeft,qt=Ht+Re.offsetWidth;if(Ht>=je&&qt<=gt)return;const sn=se.scrollWidth-se.clientWidth;let en=je;if(!A&&$e.current===null){const gi=at.current[ge-1],An=at.current[ge+1],Zn=gi?Re.offsetLeft-gi.offsetLeft:An?An.offsetLeft-Re.offsetLeft:Re.offsetWidth;qt>gt?en+=Zn:Ht<je&&(en-=Zn)}else qt>gt?en=qt-se.clientWidth:en=Ht;se.scrollLeft=Math.max(0,Math.min(sn,en))},[o,F]),yt=s.useCallback((A=!1)=>{A&&(ft.current=!0),Ge.current===null&&(Ge.current=requestAnimationFrame(()=>{Ge.current=null;const se=ft.current;ft.current=!1,Oe(se)}))},[Oe]),Tt=s.useCallback(A=>{if(A===C.current)return;const se=C.current;C.current=A;const ge=Math.abs(A-se)>1,Re=ot&&t.length>1&&(se===t.length-1&&A===0||se===0&&A===t.length-1);me(A),yt(ge||Re)},[t.length,ot,yt]),Je=()=>{if(!Ve.current||t.length===0||$e.current!==null||pt.current.isActive&&pt.current.hasMoved)return;const A=Ve.current.scrollLeft,se=D(A)%t.length;se!==C.current&&Tt(se)},Pt=()=>{$e.current=null},$t=A=>{const se=Ve.current;se&&(se.style.scrollSnapType=A?"":"none")},_t=()=>{var A;(A=_e.current)==null||A.call(_e),_e.current=null},on=()=>{Ie.current!==null&&(cancelAnimationFrame(Ie.current),Ie.current=null),mt.current=!1},fn=()=>{const A=Ve.current;if(!A){Ie.current=null,mt.current=!1;return}const se=Be.current-A.scrollLeft;if(Math.abs(se)<.5){A.scrollLeft=Be.current,Bt(),Je(),Ie.current=null,mt.current=!1;return}A.scrollLeft+=se*Wx,Bt(),Je(),Wt(),Ie.current=requestAnimationFrame(fn)},bn=()=>{const A=Ze.current;A&&(A.style.transition="",A.style.transform="",A.style.willChange="")},ui=(A,se,ge,Re)=>{bn(),A.scrollLeft=se,He.current=A.scrollLeft,Bt(),ge!==void 0?(C.current=ge,me(ge)):Je(),$t(!0),Re==null||Re()},dn=(A,{behavior:se="smooth",activeIndex:ge,onComplete:Re}={})=>{const je=Ve.current,gt=Ze.current;if(!je||!gt)return;if(on(),_t(),$t(!1),se==="auto"){ui(je,A,ge,Re);return}const Ht=Math.abs(A-je.scrollLeft),qt=Px(Ht,kx,Ax,je.clientWidth*.55);_e.current=Rx(je,gt,A,{duration:qt,easing:Fx,onComplete:()=>{_e.current=null,ui(je,A,ge,Re)}})},pi=(A="smooth")=>{const se=Ve.current;if(!se||t.length===0)return;const ge=D()%t.length,Re=jt(ge,se.scrollLeft),je=tt.current[Re];je&&dn(je.offsetLeft,{behavior:A,activeIndex:ge})},Yn=(A,se="smooth",ge,Re)=>{const je=Ve.current;if(!je||t.length===0)return;const gt=(Re??je.scrollLeft)-A,Ht=D(A),qt=tt.current[Ht];if(Kt(qt)){$t(!0),Je();return}const sn=tt.current[Ht+1],en=qt?sn?sn.offsetLeft-qt.offsetLeft:qt.offsetWidth:0;if((en>0?gt>en*Xr?1:gt<-en*Xr?-1:0:0)!==0){const Ql=ge??Ht%t.length,Go=Ne(Re??je.scrollLeft,A,Ql);Sn(Go,se);return}const An=Re??je.scrollLeft,Zn=D(An),kr=tt.current[Zn];if(kr&&Math.abs(kr.offsetLeft-An)<1){$t(!0),Je();return}pi("auto")},Sn=(A,se="smooth")=>{const ge=Ve.current;if(!ge||t.length===0)return;const Re=jt(A,ge.scrollLeft),je=tt.current[Re];je&&(se==="smooth"?$e.current=A:$e.current=null,C.current=A,me(A),yt(!0),dn(je.offsetLeft,{behavior:se,activeIndex:A,onComplete:se==="smooth"?Pt:void 0}))},mi=()=>{De.current&&(window.removeEventListener("pointerup",De.current),window.removeEventListener("pointercancel",De.current),De.current=null)},eo=(A,se,ge,Re,je)=>{const gt=ge-A,Ht=Re-se,qt=Math.abs(gt),sn=Math.abs(Ht);if(qt<Dx||qt<=sn)return!1;const en=gt<0?1:-1,gi=ot?(je+en+t.length)%t.length:Math.max(0,Math.min(t.length-1,je+en));return gi===je?!1:(Sn(gi),!0)},wn=A=>{if(!pt.current.isActive)return;mi();const se=Ve.current;if(!se)return;const{scrollLeft:ge,startActiveIndex:Re,hasMoved:je}=pt.current,gt=se.scrollLeft;Bt(!0),pt.current={isActive:!1,startX:0,scrollLeft:0,startActiveIndex:0,hasMoved:!1},nt(!1),A!==void 0&&se.hasPointerCapture(A)&&se.releasePointerCapture(A),je?Yn(ge,"smooth",Re,gt):($t(!0),Je()),Wt()},Qn=(A,se)=>{const ge=xt.current;xt.current=null,ge&&(eo(ge.startX,ge.startY,A,se,ge.startActiveIndex),Wt())},to=A=>{if(!ve)return;if(A.pointerType==="touch"){if(on(),$t(!0),Ke(A.target))return;xt.current={startX:A.clientX,startY:A.clientY,startActiveIndex:C.current};return}if(A.pointerType!=="mouse"||A.button!==0||Ke(A.target))return;const se=Ve.current;if(!se)return;on(),_t(),bn(),$e.current=null,pt.current={isActive:!0,startX:A.clientX,scrollLeft:se.scrollLeft,startActiveIndex:C.current,hasMoved:!1},$t(!1),Wt(),se.setPointerCapture(A.pointerId),mi();const ge=Re=>{Re.pointerType==="mouse"&&wn(Re.pointerId)};De.current=ge,window.addEventListener("pointerup",ge),window.addEventListener("pointercancel",ge)},no=A=>{if(!ve||A.pointerType!=="mouse")return;const se=Ve.current;if(!se||!pt.current.isActive)return;if(A.buttons===0){wn(A.pointerId);return}const ge=A.clientX-pt.current.startX;Math.abs(ge)>Ox&&(pt.current.hasMoved=!0,nt(!0)),pt.current.hasMoved&&(A.preventDefault(),se.scrollLeft=pt.current.scrollLeft-ge,Bt(!0),Je(),Wt())},xe=A=>{if(ve){if(A.pointerType==="touch"){A.type==="pointerup"?Qn(A.clientX,A.clientY):xt.current=null;return}A.pointerType==="mouse"&&wn(A.pointerId)}},qe=A=>{!ve||A.pointerType!=="mouse"||wn(A.pointerId)};return Vl(),s.useEffect(()=>{const A=requestAnimationFrame(()=>ht(!0));return()=>{cancelAnimationFrame(A),_t(),mi(),Ge.current!==null&&(cancelAnimationFrame(Ge.current),Ge.current=null),wt.current&&clearTimeout(wt.current),vt.current&&clearTimeout(vt.current)}},[]),s.useEffect(()=>{if(!le){Zt(!0);return}Wt();const A=()=>Wt();return document.addEventListener("pointermove",A,{passive:!0}),document.addEventListener("pointerdown",A,{passive:!0}),()=>{document.removeEventListener("pointermove",A),document.removeEventListener("pointerdown",A),vt.current&&clearTimeout(vt.current)}},[le,Wt]),s.useEffect(()=>{const A=se=>{se.key==="Escape"&&Dt()};return window.addEventListener("keydown",A),()=>window.removeEventListener("keydown",A)},[Dt]),s.useLayoutEffect(()=>{Ot()},[f,t.length,ot]),s.useLayoutEffect(()=>{o||Sn(C.current,"auto")},[f,o]),s.useLayoutEffect(()=>{Sn(0,"auto")},[t.length,ot]),s.useEffect(()=>{const A=Ve.current;if(!A||o||!oe)return;const se=ge=>{if(ge.preventDefault(),Math.abs(ge.deltaY)<=Math.abs(ge.deltaX))return;const Re=ge.deltaMode===1?Hx:ge.deltaMode===2?A.clientHeight:1,je=ge.deltaY*Re*_x;if(je!==0){if(_t(),mt.current||(mt.current=!0,Be.current=A.scrollLeft,$e.current=null,$t(!1)),Be.current+=je,!ot){const gt=A.scrollWidth-A.clientWidth;Be.current=Math.max(0,Math.min(gt,Be.current))}Wt(),Ie.current===null&&(Ie.current=requestAnimationFrame(fn))}};return A.addEventListener("wheel",se,{passive:!1}),()=>{A.removeEventListener("wheel",se),on()}},[o,oe,ot]),s.useEffect(()=>{const A=Ve.current;if(!A)return;const se=()=>{Bt(pt.current.isActive);const Re=A.scrollLeft,je=Re-He.current;He.current=Re;const gt=Ye.current>0?Ye.current*.5:1/0;if(je!==0&&Math.abs(je)<gt){const Ht=je>0?"forward":"backward";Ht!==Ae.current&&(Ae.current=Ht,Le(Ht))}pt.current.isActive&&pt.current.hasMoved||Je()};A.addEventListener("scroll",se,{passive:!0});const ge=new ResizeObserver(()=>{Ot(),Bt(pt.current.isActive),Le(Ae.current),Je()});return ge.observe(A),()=>{_t(),A.removeEventListener("scroll",se),ge.disconnect()}},[t.length,ot]),a.jsxs("div",{"data-selection":"none",className:`${e}-lightbox${i?` ${e}-lightbox-editor`:""}${o?` ${e}-lightbox-edit-mode`:""}`,onClick:()=>{st||Dt()},role:"dialog","aria-modal":"true","aria-label":"Image gallery",style:{opacity:Rt?1:0,transition:`opacity ${cr}ms ease`,pointerEvents:Rt?"auto":"none"},children:[a.jsx("div",{className:`${e}-lightbox-backdrop`,style:{backgroundColor:c,...It}}),a.jsxs("div",{ref:Te,className:`${e}-lightbox-dismiss-area`,style:Ut,...Xt,children:[a.jsx("div",{className:`${e}-lightbox-content`,style:At,onClick:A=>A.stopPropagation(),children:a.jsx("div",{ref:Ve,className:`${e}-lightbox-strip`,"data-lightbox-scrollable":"","data-mouse-draggable":ve&&t.length>0?"true":"false","data-mouse-dragging":St?"true":"false",onPointerDown:to,onPointerMove:no,onPointerUp:xe,onPointerCancel:xe,onLostPointerCapture:qe,children:a.jsx("div",{ref:Ze,className:`${e}-lightbox-strip-track`,style:{gap:f},children:rt.map((A,se)=>{const ge=A.image.objectFit??"contain",Re=se%t.length,je=Math.floor(se/t.length),gt=Ur(f),Ht=`calc(-0.5 * (${gt} + ${f}))`;return a.jsxs("div",{ref:qt=>tt.current[se]=qt,className:`${e}-strip-item`,style:{height:Y==="mobile"?"calc(0.75 * var(--cntrl-viewport-height, 100vh))":"100%"},children:[a.jsx("img",{src:A.image.assetId,draggable:!1,style:{display:"block",maxWidth:"100%",height:"100%",objectFit:ge}}),o&&Re<t.length-1&&je===0&&a.jsx("div",{"data-controls":"imageGap","data-controls-axis":"x",style:{position:"absolute",top:0,right:Ht,width:gt,height:"100%",pointerEvents:"auto",zIndex:3}})]},`${je}-${A.image.assetId}-${Re}`)})})})}),a.jsxs("div",{className:`${e}-lightbox-content-inner`,"data-overlay-content-hidden":Nt?"true":"false",style:ut,children:[a.jsx("div",{style:{position:"relative",width:"100%",height:Q,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${ie?` ${e}-lightbox-content-area-stacked`:""}`,children:(Se||S)&&a.jsx("div",{className:`${e}-header ${ie?`${e}-header-two-row`:`${e}-header-single-row`}`,children:ie?dt():Se||S?kt():null})})})]}),t.length>1&&F==="on"&&(()=>{const A=Ur(E),se=`calc(-0.5 * (${E} + ${A}))`;return a.jsx("div",{className:`${e}-thumbnails-wrap`,style:{bottom:E},children:a.jsx("div",{ref:et,className:`${e}-thumbnails`,"data-lightbox-scrollable":"",onClick:ge=>ge.stopPropagation(),children:a.jsxs("div",{className:`${e}-thumbnails-track`,"data-thumbnail-active":P,style:{gap:U,"--thumbnail-active-color":M},children:[t.map((ge,Re)=>{const je=Ur(U),gt=`calc(-0.5 * (${je} + ${U}))`;return a.jsxs("div",{ref:Ht=>{at.current[Re]=Ht},style:{position:"relative",flex:"0 0 auto"},children:[a.jsx("button",{type:"button",className:`${e}-thumb`,"data-active":k===Re?"true":"false",onClick:()=>oe&&w==="click"&&Sn(Re),onMouseEnter:()=>Fe&&w==="hover"&&Sn(Re),"aria-label":ge.image.name?`View ${ge.image.name}`:`View image ${Re+1}`,"aria-current":k===Re?"true":void 0,children:a.jsx("img",{className:`${e}-thumb-image${Ee?` ${e}-thumb-image-cover`:""}`,src:ge.image.assetId,alt:"",draggable:!1,style:{...Ce,maxWidth:O,maxHeight:O,width:v.display==="cover"?"auto":"100%",height:"auto",objectFit:v.display==="cover"?"cover":"contain"}})}),o&&Re<t.length-1&&a.jsx("div",{"data-controls":"thumbnailGap","data-controls-axis":"x",style:{position:"absolute",top:0,right:gt,width:je,height:"100%",pointerEvents:"auto",zIndex:3}})]},`thumb-${ge.image.assetId}-${Re}`)}),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:se,height:A,pointerEvents:"auto",zIndex:3}})]})})})})()]})]})};function Zx(e){return`
|
|
14681
|
+
`;function yi(e){return{type:"number",scope:"layout",title:e,min:0,max:100,display:{type:"range-control"}}}const id={fontSettings:{type:"object",display:{type:"font-settings-weight"},properties:{fontWeight:{type:"number"},fontStyle:{type:"string"}}}},$x=["questionColor","answerColor","dividerColor","iconColor","questionHoverColor","iconHoverColor","iconActiveColor","dividerHoverColor"],Cx={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:yi("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:{...id.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:{...id.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:yi("Question Padding Left"),questionPaddingTop:yi("Question Padding Top"),questionPaddingBottom:yi("Question Padding Bottom"),answerPaddingLeft:yi("Answer Padding Left"),answerPaddingRight:yi("Answer Padding Right"),answerPaddingTop:yi("Answer Padding Top"),answerPaddingBottom:yi("Answer Padding Bottom")},defaults:{dividerStyle:"dotted",entryHoverEffect:"default",autoclose:"off",icon:"01M3QM74XGFBPMXNEQB1BXSD9E",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:[...$x],panelIds:["general","typeStyle"],stateItems:{default:["questionColor","answerColor","dividerColor","iconColor","questionHoverColor","dividerHoverColor","iconHoverColor","iconActiveColor"]}}},Tx={element:Sx,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:Cx,sourceCode:wx},li=e=>e.display==="cover",Va=e=>{const t=e.ratioValue??"1:1",n=e.reversed??!1,[i,o]=t.split(":").map(Number);return`${n?o:i} / ${n?i:o}`},od=100,Ix=.2,rd=8,Sp=({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"?od:Math.max(od,window.innerHeight*Ix),[]),y=s.useCallback(T=>Math.max(0,1-T/(p*1.5)),[p]),S=s.useCallback(T=>Math.max(0,1-T/(p*.45)),[p]),m=s.useCallback(T=>{const L=typeof window<"u"?window.innerHeight:800,Y=Math.max(.88,1-T/L*.12);return`translateY(${T}px) scale(${Y})`},[]),h=s.useCallback(()=>{d.current=null},[]),x=s.useCallback(()=>{c(!0),r(0),window.setTimeout(()=>c(!1),n),h()},[n,h]),w=s.useCallback(()=>{const T=typeof window<"u"?window.innerHeight:800;c(!0),r(T),window.setTimeout(()=>{t(),h(),c(!1)},Math.min(n,200))},[n,t,h]),F=s.useCallback(T=>{!e||l||T.pointerType==="touch"&&(i!=null&&i(T.target)||(d.current={startX:T.clientX,startY:T.clientY,isLocked:null,pointerId:T.pointerId}))},[e,l,i]),v=s.useCallback(T=>{const L=d.current;if(!e||!L||T.pointerType!=="touch"||L.pointerId!==T.pointerId)return;const Y=T.clientX-L.startX,R=T.clientY-L.startY;if(L.isLocked===null){if(Math.abs(Y)<rd&&Math.abs(R)<rd)return;if(R>0&&R>Math.abs(Y))L.isLocked=!0,T.currentTarget.setPointerCapture(T.pointerId);else{L.isLocked=!1,h();return}}if(!L.isLocked)return;T.preventDefault();const I=Math.max(0,R);u.current=I,r(I)},[e,h]),P=s.useCallback(T=>{const L=d.current;if(!e||!L||T.pointerType!=="touch"||L.pointerId!==T.pointerId)return;const Y=L.isLocked===!0;if(T.currentTarget.hasPointerCapture(T.pointerId)&&T.currentTarget.releasePointerCapture(T.pointerId),!Y){h();return}T.clientY-L.startY>=p?w():x()},[p,w,e,h,x]),M=s.useCallback(T=>{P(T)},[P]),K=s.useCallback(T=>{P(T)},[P]),X=o>0,j=l?`transform ${n}ms ease`:"none",N=l?`opacity ${n}ms ease`:"none",_=o>0||l;return{isSwipeDragging:X,backdropStyle:{opacity:y(o),transition:N},mediaAreaStyle:{transform:m(o),transition:j,touchAction:X?"none":void 0,willChange:X?"transform":void 0},overlayContentStyle:_?{opacity:S(o),transition:N}:void 0,swipeHandlers:e?{onPointerDown:F,onPointerMove:v,onPointerUp:M,onPointerCancel:K}:{},dismissAreaStyle:e?{touchAction:X?"none":"pan-x"}:void 0}},Lx="[data-lightbox-scrollable]",Vl=(e=!0)=>{s.useEffect(()=>{if(!e)return;const t=window.scrollY,n=document.body.style.overflow,i=document.body.style.position,o=document.body.style.top,r=document.body.style.width,l=document.documentElement.style.overflow;document.body.style.overflow="hidden",document.body.style.position="fixed",document.body.style.top=`-${t}px`,document.body.style.width="100%",document.documentElement.style.overflow="hidden";const c=d=>{const u=d.target;u instanceof Element&&u.closest(Lx)||d.preventDefault()};return document.addEventListener("touchmove",c,{passive:!1}),()=>{document.removeEventListener("touchmove",c),document.body.style.overflow=n,document.body.style.position=i,document.body.style.top=o,document.body.style.width=r,document.documentElement.style.overflow=l,window.scrollTo({top:t,left:0,behavior:"instant"})}},[e])},Px=(e,t,n,i)=>{const o=Math.min(Math.abs(e)/Math.max(i,1),1);return t+(n-t)*o},Mx=e=>{e.style.transition="",e.style.transform="",e.style.willChange=""},Ex=e=>{const t=getComputedStyle(e).transform;return t==="none"?0:new DOMMatrixReadOnly(t).m41},Rx=(e,t,n,{duration:i,easing:o,onComplete:r})=>{const l=e.scrollLeft,c=n-l,d=l-n,u=(h,x)=>{Mx(t),e.scrollLeft=h,x&&(r==null||r())};if(Math.abs(c)<.5)return u(n,!0),()=>{};let p=!1,y=0;const S=()=>{t.removeEventListener("transitionend",m),clearTimeout(y)},m=h=>{h.target!==t||h.propertyName!=="transform"||p||(p=!0,S(),u(n,!0))};return t.addEventListener("transitionend",m),t.style.willChange="transform",t.style.transition="none",t.style.transform="translate3d(0, 0, 0)",t.offsetHeight,t.style.transition=`transform ${i}ms ${o}`,t.style.transform=`translate3d(${d}px, 0, 0)`,y=window.setTimeout(()=>{p||(p=!0,S(),u(n,!0))},i+64),()=>{p||(p=!0,S(),u(l-Ex(t),!1))}},cr=300,kx=900,Ax=1500,Fx="cubic-bezier(0.16, 1, 0.3, 1)",Nx=3e3,_x=2,Hx=16,Wx=.05,Ox=1,Xr=.3,Dx=50,zx=20,ro=.004,Fo=["title1","title2","title3"],Bx={title1:"1",title2:"2",title3:"3"},jx={title1:"title1Color",title2:"title2Color",title3:"title3Color"},Vx={title1:.02,title2:.02,title3:.02},Ur=e=>`max(${e}, ${zx}px)`,Gx=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]}},Xx=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=Gx(e.text);return{title1:t.title1??"",title2:t.title2??"",title3:t.title3??""}},Jt=(e,t)=>`${e}${t.charAt(0).toUpperCase()}${t.slice(1)}`,Ux=e=>[Jt(e,"fontFamily"),Jt(e,"fontSettings"),{type:"row",items:[Jt(e,"fontSize"),Jt(e,"lineHeight"),Jt(e,"letterSpacing"),Jt(e,"wordSpacing")]},Jt(e,"textAlign"),Jt(e,"textAppearance")],qx=()=>({type:"tab",id:"stripTextStyle",tabs:Object.fromEntries(Fo.map(e=>[Bx[e],Ux(e)]))}),Gl=(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},wp=(e,t)=>Gl(e,t),qr=(e,t)=>{const n=t.filter((i,o)=>o!==e).reduce((i,o)=>i+o,0);return Math.max(1-n,0)},ad=(e,t)=>{const n=e.map(i=>t[i.widthKey]??0);return{resolved:Gl(e.length,n),effective:wp(e.length,n)}},Kx=(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},hs=(e,t)=>{const n=i=>{const o=Jt(t,i);return e[o]};return{fontFamily:n("fontFamily")??"Arial",fontSettings:n("fontSettings")??{fontWeight:400,fontStyle:"normal"},fontSize:n("fontSize"),lineHeight:n("lineHeight"),letterSpacing:n("letterSpacing")??0,wordSpacing:n("wordSpacing")??0,textAlign:n("textAlign")??"left",textAppearance:n("textAppearance"),color:e[jx[t]]}},Yx=(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),fs=(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??Vx[e],lineHeight:t.lineHeight,letterSpacing:t.letterSpacing,wordSpacing:t.wordSpacing,textAlign:t.textAlign,textAppearance:t.textAppearance,color:t.color??"#ffffff"};return nn(i,n)},Qx=({prefix:e,images:t,settings:n,isEditor:i,isEditMode:o,isPreviewMode:r,onClose:l})=>{const{backgroundColor:c,thumbnailSize:d,thumbnailGap:u,thumbnailMarginBottom:p,imageGap:y,closeIcon:S,closeIconMaxWidth:m,closeIconColor:h,closeIconHoverColor:x,thumbnailTrigger:w,thumbnailVisibility:F,thumbnailObjectFit:v,thumbnailActive:P,thumbnailActiveColor:M,title1Width:K,title2Width:X,title3Width:j,title1MarginLeft:N=0,title2MarginLeft:_=0,title3MarginLeft:T=0,titleRowMarginBottom:L=0,titleHeaderLayout:Y="desktop",contentMarginTop:R,iconMarginLeft:I}=n,$=A=>b.scalingValue(A,i??!1),G=d??n.thumnailSize??.03,O=$(G),U=$(u),E=$(p??.02),f=$(y??0),Q=$(R??0),q=Ur(Q),pe=$(I??0),[k,me]=s.useState(0),C=s.useRef(k);C.current=k;const ue=t[k],{title1:te,title2:fe,title3:Pe}=Xx(ue),de=fs("title1",hs(n,"title1"),i),we=fs("title2",hs(n,"title2"),i),V=fs("title3",hs(n,"title3"),i),ie=Y==="mobile",oe=!o&&(!i||r),le=oe,ve=oe,Fe=oe,Ee=li(v),Ce=Ee?{"--image-aspect-ratio":Va(v)}:void 0,Se=!!(te||fe||Pe),g=s.useMemo(()=>Kx(e,te,fe,Pe,de,we,V),[e,k,te,fe,Pe,de,we,V]),Z=s.useMemo(()=>({title1Width:K,title2Width:X,title3Width:j}),[K,X,j]),J=s.useMemo(()=>g.map(A=>Z[A.widthKey]),[g,Z]),re=s.useMemo(()=>Gl(g.length,J),[g.length,J]),he=s.useMemo(()=>wp(g.length,J),[g.length,J]),z=s.useMemo(()=>g.filter(A=>A.prefix==="title1"),[g]),B=s.useMemo(()=>g.filter(A=>A.prefix==="title2"||A.prefix==="title3"),[g]),ne=s.useMemo(()=>ad(z,Z),[z,Z]),ce=s.useMemo(()=>ad(B,Z),[B,Z]),ee=s.useCallback((A,se)=>{const ge=g.indexOf(A);if(!ie||se==="single-row")return{effectiveWidth:he[ge]??0,resolvedWidth:re[ge]??0,maxWidth:qr(ge,re)};if(se==="two-row-top"){const je=z.indexOf(A);return{effectiveWidth:ne.effective[je]??0,resolvedWidth:ne.resolved[je]??0,maxWidth:qr(je,ne.resolved)}}const Re=B.indexOf(A);return{effectiveWidth:ce.effective[Re]??0,resolvedWidth:ce.resolved[Re]??0,maxWidth:qr(Re,ce.resolved)}},[B,ce,he,re,g,z,ne,ie]),H=s.useCallback(A=>b.scalingValue(A,i??!1),[i]),be=H(L??0),ae=s.useMemo(()=>({title1MarginLeft:N,title2MarginLeft:_,title3MarginLeft:T}),[N,_,T]),W=s.useCallback(A=>g.slice(0,A+1).reduce((se,ge,Re)=>se+(ge!=null&&ge.marginLeftKey?ae[ge.marginLeftKey]??0:0)+(re[Re]??0),0)+(ie?0:N??0),[g,ae,re,ie,N]),ke=s.useCallback(()=>ie?0:N??0,[ie,N]),ze=s.useCallback(A=>B.slice(0,A).reduce((se,ge,Re)=>se+(ge.marginLeftKey?ae[ge.marginLeftKey]??0:0)+(ce.resolved[Re]??0),0),[B,ce.resolved,ae]),Xe=s.useCallback(A=>{const se=B[A];return ze(A)+(se.marginLeftKey?ae[se.marginLeftKey]??0:0)+(ce.resolved[A]??0)},[B,ce.resolved,ze,ae]),Ue=(A,se)=>{const ge=A.marginLeftKey?ae[A.marginLeftKey]??0:0,{effectiveWidth:Re,resolvedWidth:je,maxWidth:gt}=ee(A,se),Ht=o&&se==="two-row-top";return a.jsxs("div",{className:`${e}-title-cell`,"data-title":A.prefix,style:{...se==="single-row"?{gridArea:A.prefix}:{},width:H(Re),...ge>0?{marginLeft:H(ge)}:{}},children:[a.jsx("p",{className:A.className,style:A.style,children:A.text}),Ht&&A.marginLeftKey&&a.jsx("div",{"data-controls":A.marginLeftKey,"data-controls-axis":"x","data-controls-min":"0","data-controls-max-fraction":String(je),style:{position:"absolute",top:0,left:H(-ge),width:`max(${H(ge)}, 10px)`,height:"100%",pointerEvents:"auto"}}),Ht&&a.jsx("div",{"data-controls":A.widthKey,"data-controls-axis":"x","data-controls-max-fraction":String(gt),"data-controls-variant":"column-width",className:`${e}-title-resize-handle`,style:{position:"absolute",top:0,right:H(-ro/2),width:H(ro),height:"100%",pointerEvents:"auto"}})]},A.className)},Qe=()=>{const A=ie?-1:g.findIndex(Re=>Re.prefix==="title1"),se=!ie&&(o||(N??0)>0)?(()=>{const Re=N??0,je=A>=0?re[A]:K??0;return a.jsx("div",{"data-controls":"title1MarginLeft","data-controls-axis":"x","data-controls-min":"0","data-controls-max-fraction":String(je),style:{position:"absolute",top:0,left:0,width:`max(${H(Re)}, 10px)`,height:"100%",pointerEvents:"auto"}},"title1MarginLeft")})():null,ge=g.flatMap((Re,je)=>{if(!Re.marginLeftKey)return[];const gt=ae[Re.marginLeftKey]??0,Ht=Yx(g,re,ae,je)+ke();return a.jsx("div",{"data-controls":Re.marginLeftKey,"data-controls-axis":"x","data-controls-min":"0","data-controls-max-fraction":String(re[je]),style:{position:"absolute",top:0,left:H(Ht),width:`max(${H(gt)}, 10px)`,height:"100%",pointerEvents:"auto"}},Re.marginLeftKey)});return se?[se,...ge]:ge},We=()=>g.map((A,se)=>{const ge=qr(se,re),je=W(se)-ro/2;return a.jsx("div",{style:{position:"absolute",inset:0,pointerEvents:"none"},children:a.jsx("div",{"data-controls":A.widthKey,"data-controls-axis":"x","data-controls-max-fraction":String(ge),"data-controls-variant":"column-width",className:`${e}-title-resize-handle`,style:{position:"absolute",top:0,left:H(je),width:H(ro),height:"100%",pointerEvents:"auto"}})},`${A.widthKey}-junction`)}),it=()=>B.flatMap((A,se)=>{if(!A.marginLeftKey)return[];const ge=ae[A.marginLeftKey]??0,Re=ze(se),{resolvedWidth:je}=ee(A,"two-row-bottom");return a.jsx("div",{"data-controls":A.marginLeftKey,"data-controls-axis":"x","data-controls-min":"0","data-controls-max-fraction":String(je),style:{position:"absolute",top:0,left:H(Re),width:`max(${H(ge)}, 10px)`,height:"100%",pointerEvents:"auto"}},A.marginLeftKey)}),ye=()=>B.map((A,se)=>{const{maxWidth:ge}=ee(A,"two-row-bottom"),je=Xe(se)-ro/2;return a.jsx("div",{style:{position:"absolute",inset:0,pointerEvents:"none"},children:a.jsx("div",{"data-controls":A.widthKey,"data-controls-axis":"x","data-controls-max-fraction":String(ge),"data-controls-variant":"column-width",className:`${e}-title-resize-handle`,style:{position:"absolute",top:0,left:H(je),width:H(ro),height:"100%",pointerEvents:"auto"}})},`${A.widthKey}-junction`)}),Te=s.useRef(null),Ve=s.useRef(null),Ze=s.useRef(null),et=s.useRef(null),at=s.useRef([]),tt=s.useRef([]),Ye=s.useRef(0),xt=s.useRef(null),pt=s.useRef({isActive:!1,startX:0,scrollLeft:0,startActiveIndex:0,hasMoved:!1}),De=s.useRef(null),_e=s.useRef(null),He=s.useRef(0),Ae=s.useRef("forward"),Be=s.useRef(0),Ie=s.useRef(null),mt=s.useRef(!1),ot=t.length>1&&(!o||!!r),Ct=ot?3:1,rt=s.useMemo(()=>Array.from({length:Ct},()=>t).flat(),[t,Ct]),[St,nt]=s.useState(!1),[Rt,ht]=s.useState(!1),[Vt,Zt]=s.useState(!0),$e=s.useRef(null),Ge=s.useRef(null),ft=s.useRef(!1),Lt=s.useRef(!1),wt=s.useRef(null),vt=s.useRef(null),Nt=le&&!Vt,Wt=s.useCallback(()=>{le&&(Zt(!0),vt.current&&clearTimeout(vt.current),vt.current=setTimeout(()=>{pt.current.isActive||Zt(!1)},Nx))},[le]),Dt=s.useCallback(()=>{o||Lt.current||(Lt.current=!0,ht(!1),wt.current=setTimeout(()=>{l()},cr))},[o,l]),Me=()=>a.jsxs("div",{className:`${e}-close-icon`,"data-overlay-content-hidden":Nt?"true":"false",style:{width:b.scalingValue(m??0,i),height:b.scalingValue(m??0,i),marginRight:pe,"--close-icon-hover-color":x},children:[a.jsx("button",{type:"button",className:`${e}-close-icon-inner`,onClick:Dt,"aria-label":"Close",children:a.jsx(mn,{url:S,fill:h,hoverFill:i&&!r?h:x,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:pe,height:"100%",pointerEvents:"auto"}})]}),ct=(A="two-row")=>a.jsx("div",{...A==="two-row"&&o?{"data-controls":"title1MarginLeft","data-controls-axis":"x"}:{},style:{width:H(N??0),flexShrink:0,...A==="single-row"?{gridArea:"margin"}:{alignSelf:"stretch"},...A==="two-row"&&o?{pointerEvents:"auto"}:{}}}),dt=()=>{const A=g.find(Re=>Re.prefix==="title1"),se=g.filter(Re=>Re.prefix==="title2"||Re.prefix==="title3"),ge=se.length>0||o||(L??0)>0;return a.jsxs(a.Fragment,{children:[a.jsxs("div",{className:`${e}-header-row-top`,children:[(N??0)>0||o?ct():null,A&&Ue(A,"two-row-top"),S&&Me()]}),ge?a.jsxs("div",{className:`${e}-header-row-bottom-wrap`,children:[se.length>0?a.jsxs("div",{className:`${e}-header-row-bottom`,children:[se.map(Re=>Ue(Re,"two-row-bottom")),o&&a.jsxs(a.Fragment,{children:[it(),ye()]})]}):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:be,width:"100%",flexShrink:0,pointerEvents:o?"auto":"none"}})]}):null]})},kt=()=>a.jsxs(a.Fragment,{children:[(N??0)>0||o?ct("single-row"):null,g.map(A=>Ue(A,"single-row")),o?a.jsxs(a.Fragment,{children:[Qe(),We()]}):null,S?Me():null]}),Ke=s.useCallback(A=>!!(A.closest("[data-controls]")||A.closest(`.${e}-thumbnails`)||A.closest(`.${e}-close-icon`)),[e]),{isSwipeDragging:st,backdropStyle:It,mediaAreaStyle:At,overlayContentStyle:ut,swipeHandlers:Gt,dismissAreaStyle:Ut}=Sp({enabled:oe??!1,onClose:Dt,animMs:cr,isBlockedTarget:Ke}),Ot=()=>{if(!ot||t.length===0)return Ye.current=0,0;const A=tt.current[0],se=tt.current[t.length];if(!A||!se)return Ye.current;const ge=se.offsetLeft-A.offsetLeft;return ge>0&&(Ye.current=ge),Ye.current},Bt=(A=!1)=>{if(!ot)return;const se=Ve.current,ge=Ot();!se||ge<=0||ge<se.clientWidth*.25||(se.scrollLeft<=0?(se.scrollLeft+=ge,A&&(pt.current.scrollLeft+=ge),mt.current&&(Be.current+=ge)):se.scrollLeft>=ge*2&&(se.scrollLeft-=ge,A&&(pt.current.scrollLeft-=ge),mt.current&&(Be.current-=ge)))},Xt=(A,se=(ge=>(ge=Ve.current)==null?void 0:ge.scrollLeft)()??0)=>{if(!ot)return A;let Re=t.length+A,je=1/0;for(let gt=0;gt<Ct;gt++){const Ht=gt*t.length+A,qt=tt.current[Ht];if(!qt)continue;const sn=Math.abs(qt.offsetLeft-se);sn<je&&(je=sn,Re=Ht)}return Re},zt=A=>{const se=Ve.current;return!A||!se?!1:A.offsetWidth>se.clientWidth+1},Kt=A=>{const se=Ve.current;if(!A||!se||!zt(A))return!1;const ge=A.offsetLeft,Re=ge+A.offsetWidth;return se.scrollLeft>=ge-1&&se.scrollLeft+se.clientWidth<=Re+1},D=(A=(se=>(se=Ve.current)==null?void 0:se.scrollLeft)()??0)=>{for(let Re=0;Re<tt.current.length;Re+=1){const je=tt.current[Re];if(je&&Kt(je))return Re}let ge={flatIndex:0,distance:1/0};return tt.current.forEach((Re,je)=>{if(!Re)return;const gt=Math.abs(Re.offsetLeft-A);gt<ge.distance&&(ge={flatIndex:je,distance:gt})}),ge.flatIndex},Le=A=>{Ve.current&&tt.current.forEach(se=>{se&&(se.style.scrollSnapAlign=zt(se)&&A==="backward"?"end":"start")})},Ne=(A,se,ge)=>{const Re=A-se,je=D(se),gt=tt.current[je];if(Kt(gt))return D(A)%t.length;const Ht=tt.current[je+1],qt=gt?Ht?Ht.offsetLeft-gt.offsetLeft:gt.offsetWidth:0,sn=qt>0?Re>qt*Xr?1:Re<-qt*Xr?-1:0:0;return sn===0?ge:ot?(ge+sn+t.length)%t.length:Math.max(0,Math.min(t.length-1,ge+sn))},Oe=s.useCallback((A=!1)=>{if(F!=="on"||o)return;const se=et.current,ge=C.current,Re=at.current[ge];if(!se||!Re||se.scrollWidth<=se.clientWidth)return;const je=se.scrollLeft,gt=je+se.clientWidth,Ht=Re.offsetLeft,qt=Ht+Re.offsetWidth;if(Ht>=je&&qt<=gt)return;const sn=se.scrollWidth-se.clientWidth;let en=je;if(!A&&$e.current===null){const gi=at.current[ge-1],An=at.current[ge+1],Zn=gi?Re.offsetLeft-gi.offsetLeft:An?An.offsetLeft-Re.offsetLeft:Re.offsetWidth;qt>gt?en+=Zn:Ht<je&&(en-=Zn)}else qt>gt?en=qt-se.clientWidth:en=Ht;se.scrollLeft=Math.max(0,Math.min(sn,en))},[o,F]),yt=s.useCallback((A=!1)=>{A&&(ft.current=!0),Ge.current===null&&(Ge.current=requestAnimationFrame(()=>{Ge.current=null;const se=ft.current;ft.current=!1,Oe(se)}))},[Oe]),Tt=s.useCallback(A=>{if(A===C.current)return;const se=C.current;C.current=A;const ge=Math.abs(A-se)>1,Re=ot&&t.length>1&&(se===t.length-1&&A===0||se===0&&A===t.length-1);me(A),yt(ge||Re)},[t.length,ot,yt]),Je=()=>{if(!Ve.current||t.length===0||$e.current!==null||pt.current.isActive&&pt.current.hasMoved)return;const A=Ve.current.scrollLeft,se=D(A)%t.length;se!==C.current&&Tt(se)},Pt=()=>{$e.current=null},$t=A=>{const se=Ve.current;se&&(se.style.scrollSnapType=A?"":"none")},_t=()=>{var A;(A=_e.current)==null||A.call(_e),_e.current=null},on=()=>{Ie.current!==null&&(cancelAnimationFrame(Ie.current),Ie.current=null),mt.current=!1},fn=()=>{const A=Ve.current;if(!A){Ie.current=null,mt.current=!1;return}const se=Be.current-A.scrollLeft;if(Math.abs(se)<.5){A.scrollLeft=Be.current,Bt(),Je(),Ie.current=null,mt.current=!1;return}A.scrollLeft+=se*Wx,Bt(),Je(),Wt(),Ie.current=requestAnimationFrame(fn)},bn=()=>{const A=Ze.current;A&&(A.style.transition="",A.style.transform="",A.style.willChange="")},ui=(A,se,ge,Re)=>{bn(),A.scrollLeft=se,He.current=A.scrollLeft,Bt(),ge!==void 0?(C.current=ge,me(ge)):Je(),$t(!0),Re==null||Re()},dn=(A,{behavior:se="smooth",activeIndex:ge,onComplete:Re}={})=>{const je=Ve.current,gt=Ze.current;if(!je||!gt)return;if(on(),_t(),$t(!1),se==="auto"){ui(je,A,ge,Re);return}const Ht=Math.abs(A-je.scrollLeft),qt=Px(Ht,kx,Ax,je.clientWidth*.55);_e.current=Rx(je,gt,A,{duration:qt,easing:Fx,onComplete:()=>{_e.current=null,ui(je,A,ge,Re)}})},pi=(A="smooth")=>{const se=Ve.current;if(!se||t.length===0)return;const ge=D()%t.length,Re=Xt(ge,se.scrollLeft),je=tt.current[Re];je&&dn(je.offsetLeft,{behavior:A,activeIndex:ge})},Yn=(A,se="smooth",ge,Re)=>{const je=Ve.current;if(!je||t.length===0)return;const gt=(Re??je.scrollLeft)-A,Ht=D(A),qt=tt.current[Ht];if(Kt(qt)){$t(!0),Je();return}const sn=tt.current[Ht+1],en=qt?sn?sn.offsetLeft-qt.offsetLeft:qt.offsetWidth:0;if((en>0?gt>en*Xr?1:gt<-en*Xr?-1:0:0)!==0){const Ql=ge??Ht%t.length,Go=Ne(Re??je.scrollLeft,A,Ql);Sn(Go,se);return}const An=Re??je.scrollLeft,Zn=D(An),kr=tt.current[Zn];if(kr&&Math.abs(kr.offsetLeft-An)<1){$t(!0),Je();return}pi("auto")},Sn=(A,se="smooth")=>{const ge=Ve.current;if(!ge||t.length===0)return;const Re=Xt(A,ge.scrollLeft),je=tt.current[Re];je&&(se==="smooth"?$e.current=A:$e.current=null,C.current=A,me(A),yt(!0),dn(je.offsetLeft,{behavior:se,activeIndex:A,onComplete:se==="smooth"?Pt:void 0}))},mi=()=>{De.current&&(window.removeEventListener("pointerup",De.current),window.removeEventListener("pointercancel",De.current),De.current=null)},eo=(A,se,ge,Re,je)=>{const gt=ge-A,Ht=Re-se,qt=Math.abs(gt),sn=Math.abs(Ht);if(qt<Dx||qt<=sn)return!1;const en=gt<0?1:-1,gi=ot?(je+en+t.length)%t.length:Math.max(0,Math.min(t.length-1,je+en));return gi===je?!1:(Sn(gi),!0)},wn=A=>{if(!pt.current.isActive)return;mi();const se=Ve.current;if(!se)return;const{scrollLeft:ge,startActiveIndex:Re,hasMoved:je}=pt.current,gt=se.scrollLeft;Bt(!0),pt.current={isActive:!1,startX:0,scrollLeft:0,startActiveIndex:0,hasMoved:!1},nt(!1),A!==void 0&&se.hasPointerCapture(A)&&se.releasePointerCapture(A),je?Yn(ge,"smooth",Re,gt):($t(!0),Je()),Wt()},Qn=(A,se)=>{const ge=xt.current;xt.current=null,ge&&(eo(ge.startX,ge.startY,A,se,ge.startActiveIndex),Wt())},to=A=>{if(!ve)return;if(A.pointerType==="touch"){if(on(),$t(!0),Ke(A.target))return;xt.current={startX:A.clientX,startY:A.clientY,startActiveIndex:C.current};return}if(A.pointerType!=="mouse"||A.button!==0||Ke(A.target))return;const se=Ve.current;if(!se)return;on(),_t(),bn(),$e.current=null,pt.current={isActive:!0,startX:A.clientX,scrollLeft:se.scrollLeft,startActiveIndex:C.current,hasMoved:!1},$t(!1),Wt(),se.setPointerCapture(A.pointerId),mi();const ge=Re=>{Re.pointerType==="mouse"&&wn(Re.pointerId)};De.current=ge,window.addEventListener("pointerup",ge),window.addEventListener("pointercancel",ge)},no=A=>{if(!ve||A.pointerType!=="mouse")return;const se=Ve.current;if(!se||!pt.current.isActive)return;if(A.buttons===0){wn(A.pointerId);return}const ge=A.clientX-pt.current.startX;Math.abs(ge)>Ox&&(pt.current.hasMoved=!0,nt(!0)),pt.current.hasMoved&&(A.preventDefault(),se.scrollLeft=pt.current.scrollLeft-ge,Bt(!0),Je(),Wt())},xe=A=>{if(ve){if(A.pointerType==="touch"){A.type==="pointerup"?Qn(A.clientX,A.clientY):xt.current=null;return}A.pointerType==="mouse"&&wn(A.pointerId)}},qe=A=>{!ve||A.pointerType!=="mouse"||wn(A.pointerId)};return Vl(),s.useEffect(()=>{const A=requestAnimationFrame(()=>ht(!0));return()=>{cancelAnimationFrame(A),_t(),mi(),Ge.current!==null&&(cancelAnimationFrame(Ge.current),Ge.current=null),wt.current&&clearTimeout(wt.current),vt.current&&clearTimeout(vt.current)}},[]),s.useEffect(()=>{if(!le){Zt(!0);return}Wt();const A=()=>Wt();return document.addEventListener("pointermove",A,{passive:!0}),document.addEventListener("pointerdown",A,{passive:!0}),()=>{document.removeEventListener("pointermove",A),document.removeEventListener("pointerdown",A),vt.current&&clearTimeout(vt.current)}},[le,Wt]),s.useEffect(()=>{const A=se=>{se.key==="Escape"&&Dt()};return window.addEventListener("keydown",A),()=>window.removeEventListener("keydown",A)},[Dt]),s.useLayoutEffect(()=>{Ot()},[f,t.length,ot]),s.useLayoutEffect(()=>{o||Sn(C.current,"auto")},[f,o]),s.useLayoutEffect(()=>{Sn(0,"auto")},[t.length,ot]),s.useEffect(()=>{const A=Ve.current;if(!A||o||!oe)return;const se=ge=>{if(ge.preventDefault(),Math.abs(ge.deltaY)<=Math.abs(ge.deltaX))return;const Re=ge.deltaMode===1?Hx:ge.deltaMode===2?A.clientHeight:1,je=ge.deltaY*Re*_x;if(je!==0){if(_t(),mt.current||(mt.current=!0,Be.current=A.scrollLeft,$e.current=null,$t(!1)),Be.current+=je,!ot){const gt=A.scrollWidth-A.clientWidth;Be.current=Math.max(0,Math.min(gt,Be.current))}Wt(),Ie.current===null&&(Ie.current=requestAnimationFrame(fn))}};return A.addEventListener("wheel",se,{passive:!1}),()=>{A.removeEventListener("wheel",se),on()}},[o,oe,ot]),s.useEffect(()=>{const A=Ve.current;if(!A)return;const se=()=>{Bt(pt.current.isActive);const Re=A.scrollLeft,je=Re-He.current;He.current=Re;const gt=Ye.current>0?Ye.current*.5:1/0;if(je!==0&&Math.abs(je)<gt){const Ht=je>0?"forward":"backward";Ht!==Ae.current&&(Ae.current=Ht,Le(Ht))}pt.current.isActive&&pt.current.hasMoved||Je()};A.addEventListener("scroll",se,{passive:!0});const ge=new ResizeObserver(()=>{Ot(),Bt(pt.current.isActive),Le(Ae.current),Je()});return ge.observe(A),()=>{_t(),A.removeEventListener("scroll",se),ge.disconnect()}},[t.length,ot]),a.jsxs("div",{"data-selection":"none",className:`${e}-lightbox${i?` ${e}-lightbox-editor`:""}${o?` ${e}-lightbox-edit-mode`:""}`,onClick:()=>{st||Dt()},role:"dialog","aria-modal":"true","aria-label":"Image gallery",style:{opacity:Rt?1:0,transition:`opacity ${cr}ms ease`,pointerEvents:Rt?"auto":"none"},children:[a.jsx("div",{className:`${e}-lightbox-backdrop`,style:{backgroundColor:c,...It}}),a.jsxs("div",{ref:Te,className:`${e}-lightbox-dismiss-area`,style:Ut,...Gt,children:[a.jsx("div",{className:`${e}-lightbox-content`,style:At,onClick:A=>A.stopPropagation(),children:a.jsx("div",{ref:Ve,className:`${e}-lightbox-strip`,"data-lightbox-scrollable":"","data-mouse-draggable":ve&&t.length>0?"true":"false","data-mouse-dragging":St?"true":"false",onPointerDown:to,onPointerMove:no,onPointerUp:xe,onPointerCancel:xe,onLostPointerCapture:qe,children:a.jsx("div",{ref:Ze,className:`${e}-lightbox-strip-track`,style:{gap:f},children:rt.map((A,se)=>{const ge=A.image.objectFit??"contain",Re=se%t.length,je=Math.floor(se/t.length),gt=Ur(f),Ht=`calc(-0.5 * (${gt} + ${f}))`;return a.jsxs("div",{ref:qt=>tt.current[se]=qt,className:`${e}-strip-item`,style:{height:Y==="mobile"?"calc(0.75 * var(--cntrl-viewport-height, 100vh))":"100%"},children:[a.jsx("img",{src:A.image.assetId,draggable:!1,style:{display:"block",maxWidth:"100%",height:"100%",objectFit:ge}}),o&&Re<t.length-1&&je===0&&a.jsx("div",{"data-controls":"imageGap","data-controls-axis":"x",style:{position:"absolute",top:0,right:Ht,width:gt,height:"100%",pointerEvents:"auto",zIndex:3}})]},`${je}-${A.image.assetId}-${Re}`)})})})}),a.jsxs("div",{className:`${e}-lightbox-content-inner`,"data-overlay-content-hidden":Nt?"true":"false",style:ut,children:[a.jsx("div",{style:{position:"relative",width:"100%",height:Q,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${ie?` ${e}-lightbox-content-area-stacked`:""}`,children:(Se||S)&&a.jsx("div",{className:`${e}-header ${ie?`${e}-header-two-row`:`${e}-header-single-row`}`,children:ie?dt():Se||S?kt():null})})})]}),t.length>1&&F==="on"&&(()=>{const A=Ur(E),se=`calc(-0.5 * (${E} + ${A}))`;return a.jsx("div",{className:`${e}-thumbnails-wrap`,style:{bottom:E},children:a.jsx("div",{ref:et,className:`${e}-thumbnails`,"data-lightbox-scrollable":"",onClick:ge=>ge.stopPropagation(),children:a.jsxs("div",{className:`${e}-thumbnails-track`,"data-thumbnail-active":P,style:{gap:U,"--thumbnail-active-color":M},children:[t.map((ge,Re)=>{const je=Ur(U),gt=`calc(-0.5 * (${je} + ${U}))`;return a.jsxs("div",{ref:Ht=>{at.current[Re]=Ht},style:{position:"relative",flex:"0 0 auto"},children:[a.jsx("button",{type:"button",className:`${e}-thumb`,"data-active":k===Re?"true":"false",onClick:()=>oe&&w==="click"&&Sn(Re),onMouseEnter:()=>Fe&&w==="hover"&&Sn(Re),"aria-label":ge.image.name?`View ${ge.image.name}`:`View image ${Re+1}`,"aria-current":k===Re?"true":void 0,children:a.jsx("img",{className:`${e}-thumb-image${Ee?` ${e}-thumb-image-cover`:""}`,src:ge.image.assetId,alt:"",draggable:!1,style:{...Ce,maxWidth:O,maxHeight:O,width:v.display==="cover"?"auto":"100%",height:"auto",objectFit:v.display==="cover"?"cover":"contain"}})}),o&&Re<t.length-1&&a.jsx("div",{"data-controls":"thumbnailGap","data-controls-axis":"x",style:{position:"absolute",top:0,right:gt,width:je,height:"100%",pointerEvents:"auto",zIndex:3}})]},`thumb-${ge.image.assetId}-${Re}`)}),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:se,height:A,pointerEvents:"auto",zIndex:3}})]})})})})()]})]})};function Zx(e){return`
|
|
14686
14682
|
.${e}-wrapper {
|
|
14687
14683
|
position: relative;
|
|
14688
14684
|
width: 100%;
|
|
@@ -15613,7 +15609,7 @@ export const LightboxStrip = ({ settings, content, isEditor, isEditMode, isPrevi
|
|
|
15613
15609
|
</>
|
|
15614
15610
|
);
|
|
15615
15611
|
};
|
|
15616
|
-
`,tb="01M3SBP3P8CMVMM1ZZ0QVD2PPF",Di={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 nb(e){const t={};return t[Jt(e,"fontFamily")]={type:"string",scope:"common",title:"",display:{type:"font-family-select",hideLabel:!0,useTabDesign:!0}},t[Jt(e,"fontSettings")]={...Di.fontSettings,scope:"common",title:"",display:{type:"font-settings-weight",hideLabel:!0,useTabDesign:!0}},t[Jt(e,"fontSize")]={...Di.fontSize,scope:"layout",title:"",display:{type:"font-size"}},t[Jt(e,"lineHeight")]={...Di.lineHeight,scope:"layout",title:"",display:{type:"line-height-input"}},t[Jt(e,"letterSpacing")]={...Di.letterSpacing,scope:"layout",title:"",display:{type:"letter-spacing-input"}},t[Jt(e,"wordSpacing")]={...Di.wordSpacing,scope:"layout",title:"",display:{type:"word-spacing-input"}},t[Jt(e,"textAlign")]={...Di.textAlign,scope:"layout",title:"",display:{type:"vertical-text-aligh-options"}},t[Jt(e,"textAppearance")]={...Di.textAppearance,scope:"layout",title:"",display:{type:"text-appearance",useTabDesign:!0}},t}const ib=Fo.reduce((e,t)=>({...e,...nb(t)}),{}),ob=Fo.reduce((e,t)=>({...e,[Jt(t,"fontFamily")]:"Goudy Bookletter 1911",[Jt(t,"fontSettings")]:{fontWeight:400,fontStyle:"normal"},[Jt(t,"letterSpacing")]:0,[Jt(t,"wordSpacing")]:0,[Jt(t,"textAlign")]:"left",[Jt(t,"textAppearance")]:{textTransform:"none",textDecoration:"none",fontVariant:"normal"}}),{});function ys(e){return Fo.reduce((t,n)=>{const i=e[`${n}FontSize`],o=e[`${n}LineHeight`];return i!==void 0&&(t[Jt(n,"fontSize")]=i),o!==void 0&&(t[Jt(n,"lineHeight")]=o),t},{})}const rb=qx(),ab={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"}},...ib,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:"01M3QM74XESYN1HRYH9VRTZ5CK",coverFit:{display:"fit",ratioValue:"1:1",reversed:!1},closeIcon:tb,thumbnailObjectFit:{display:"fit",ratioValue:"16:9",reversed:!1},thumbnailTrigger:"click",thumbnailActive:"color",...ob},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,...ys({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,...ys({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,...ys({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:[rb]}],paletteBookmark:{items:["title1Color","title2Color","title3Color","backgroundColor","closeIconColor","closeIconHoverColor","thumbnailActiveColor"],panelIds:["general","typeStyle"]},content:{type:"array",settings:{allowsCollection:!0,addItemFromFileExplorer:!0},items:{type:"object",properties:{image:{type:"object",label:"Image",contentKey:"gallery",display:{isObjectFitEditable:!1,defaultObjectFit:"contain",type:"media-input"}},title1:{type:"string",label:"Title",contentKey:"title",placeholder:"Add Title...",display:{type:"text-input"}},title2:{type:"string",label:"Subtitle",contentKey:"subtitle",placeholder:"Add Subtitle...",display:{type:"text-input"}},title3:{type:"string",label:"Caption",placeholder:"Add Caption...",display:{type:"text-input"}}}},default:[{image:{assetId:"01M3QM74XEVZ9F59FC7M9BA63Q",name:"",objectFit:"contain"},title1:"NASA",title2:"Apollo 9 Mission, 1969",title3:"Archival Footage"},{image:{assetId:"01M3QM74XEE2101QD8PM6E4JSA",name:"",objectFit:"contain"},title1:"NASA",title2:"Apollo 9 Mission, 1969",title3:"Archival Footage"},{image:{assetId:"01M3QM74XE20C38X4NND20C5R4",name:"",objectFit:"contain"},title1:"NASA",title2:"Apollo 9 Mission, 1969",title3:"Archival Footage"},{image:{assetId:"01M3QM74XEGBJMJ7Q63KMZY6NA",name:"",objectFit:"contain"},title1:"NASA",title2:"Apollo 9 Mission, 1969",title3:"Archival Footage"},{image:{assetId:"01M3QM74XEBS5231QA4355P4VQ",name:"",objectFit:"contain"},title1:"NASA",title2:"Apollo 9 Mission, 1969",title3:"Archival Footage"},{image:{assetId:"01M3QM74XEWT5YM43KF6PEYRCV",name:"",objectFit:"contain"},title1:"NASA",title2:"Apollo 9 Mission, 1969",title3:"Archival Footage"}]}},sb={element:Jx,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:ab,sourceCode:eb,assetsPaths:{content:[{path:"image.assetId",placeholderEnabled:!0}],parameters:[{path:"cover",placeholderEnabled:!0},{path:"closeIcon"}]},fontSettingsPaths:{content:[],parameters:[...Fo.map(e=>({path:`${Jt(e,"fontFamily")}`}))]},fontRelations:{...Fo.reduce((e,t)=>({...e,[`${t}FontSettings`]:`${Jt(t,"fontFamily")}`}),{})}},lb=({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:y,coverFit:S,backgroundColor:m,imageGap:h,maxWidth:x,maxHeight:w,textTransition:F,title1Width:v,title2Width:P,title3Width:M,title1MarginLeft:K=0,title2MarginLeft:X=0,title3MarginLeft:j=0,titleRowMarginBottom:N=0,titleHeaderLayout:_="single-row",countCloseGap:T=0,closeIcon:L,closeIconMaxWidth:Y,closeIconColor:R,closeIconHoverColor:I,contentMarginTop:$=0,iconMarginRight:G=0}=n,O=s.useCallback(xe=>b.scalingValue(xe,i??!1),[i]),U=O(h??0),E=`${x}%`,f=`${w}%`,Q=O(T),q=O($),pe=O(G),k=Gi("title1",Vi(n,"title1"),i),me=Gi("title2",Vi(n,"title2"),i),C=Gi("title3",Vi(n,"title3"),i),ue=Gi("count",Vi(n,"count"),i),te=_==="mobile",fe=!i||!!r,Pe=!o&&(!i||!!r),de=s.useMemo(()=>ma(t,y),[t,y]),[we,V]=s.useState(l),ie=de[we],oe=ie==null?void 0:ie.entry,[le,ve]=s.useState(!1),[Fe,Ee]=s.useState(null),[Ce,Se]=s.useState(!1),[g,Z]=s.useState(null),[J,re]=s.useState(!1),[he,z]=s.useState(0),[B,ne]=s.useState(),[ce,ee]=s.useState(),[H,be]=s.useState(null),ae=s.useRef(null),W=s.useRef(0),ke=s.useRef(0),ze=s.useRef(0),Xe=s.useRef(!1),Ue=s.useRef(null),Qe=s.useRef(null),We=s.useRef(null),it=s.useRef(null),ye=s.useRef(null),Te=s.useRef(null),Ve=s.useRef(null),Ze=s.useCallback(()=>{const xe=Qe.current;if(!xe)return;const qe=xe.closest(`.${e}-lightbox-content-area`);if(!qe)return xe.getBoundingClientRect().width;const A=Array.from(qe.children).reduce((se,ge)=>!(ge instanceof HTMLElement)||ge.contains(xe)?se:se+ge.getBoundingClientRect().width,0);return qe.getBoundingClientRect().width-A},[e]),et=s.useCallback(()=>{ae.current&&(clearTimeout(ae.current),ae.current=null)},[]),at=s.useCallback(xe=>{xe===W.current&&(Z(null),re(!1))},[]),tt=s.useCallback(()=>{o||Xe.current||(Xe.current=!0,u==null||u(),ve(!1),Ue.current=setTimeout(()=>{p()},300))},[o,u,p]),Ye=s.useCallback(xe=>!!(xe.closest("[data-controls]")||xe.closest(`.${e}-close-icon`)),[e]),{isSwipeDragging:xt,backdropStyle:pt,mediaAreaStyle:De,overlayContentStyle:_e,swipeHandlers:He,dismissAreaStyle:Ae}=Sp({enabled:Pe,onClose:tt,animMs:300,isBlockedTarget:Ye}),Be=s.useCallback(xe=>{c&&ip(xe+1,d,!0)},[c,d]),Ie=s.useCallback(xe=>{if(xe)return xe.getBoundingClientRect().height},[]),mt=s.useCallback(xe=>{if(de.length===0)return;const qe=(xe%de.length+de.length)%de.length;if(qe===we)return;const A=de[we],se=de[qe];W.current+=1;const ge=W.current,Re=F==="fade"&&Nc(A==null?void 0:A.entry)!==Nc(se==null?void 0:se.entry),je=Ie(We.current),gt=Re?(()=>{const qt=Ze();qn.flushSync(()=>{be(se.entry)}),We.current&&qt&&(We.current.style.width=`${qt}px`);const sn=Ie(We.current);return We.current&&(We.current.style.width=""),{measuredIncomingTitlesHeight:sn,incomingTitlesMeasureWidth:qt}})():void 0,Ht=Math.max(je??0,(gt==null?void 0:gt.measuredIncomingTitlesHeight)??0)||void 0;z(ge),Z(we),re(!0),V(qe),Be(qe),ze.current=qe,Re?(et(),Ht&&ne(Ht),gt!=null&>.incomingTitlesMeasureWidth&&ee(gt.incomingTitlesMeasureWidth),Ee((A==null?void 0:A.entryIndex)??null),Se(!0),ke.current=se.entryIndex,ae.current=setTimeout(()=>{Ee(null),Se(!1),ne(void 0),ee(void 0),be(null),ae.current=null},400)):(et(),Ee(null),Se(!1),ne(void 0),ee(void 0),be(null),ke.current=se.entryIndex)},[we,et,Ze,Ie,de,Be,F]),ot=s.useCallback(()=>{Ve.current=null},[]),Ct=s.useCallback(xe=>{!fe||de.length<=1||xe.pointerType==="mouse"&&xe.button!==0||xe.target.closest("[data-controls]")||(Ve.current={startX:xe.clientX,startY:xe.clientY,pointerId:xe.pointerId})},[fe,de.length]),rt=s.useCallback(xe=>{var qt;if(!fe||de.length<=1||xe.pointerType==="mouse"&&xe.button!==0)return;if(xt){ot();return}const qe=Ve.current;if(!qe||qe.pointerId!==xe.pointerId||(ot(),xe.target.closest("[data-controls]")))return;const se=xe.clientX-qe.startX,ge=xe.clientY-qe.startY,Re=Math.abs(se),je=Math.abs(ge);if(Re>=vv&&Re>je){mt(se>0?we-1:we+1);return}if(Re>Rc||je>Rc)return;const gt=(qt=it.current)==null?void 0:qt.getBoundingClientRect(),Ht=gt?gt.left+gt.width/2:window.innerWidth/2;mt(xe.clientX<Ht?we-1:we+1)},[we,fe,mt,xt,ot,de.length]),St=s.useCallback(xe=>{const qe=Ve.current;(qe==null?void 0:qe.pointerId)===xe.pointerId&&ot()},[ot]);Vl(),s.useEffect(()=>{Te.current=document.activeElement instanceof HTMLElement?document.activeElement:null;const xe=requestAnimationFrame(()=>{ve(!0),requestAnimationFrame(()=>{ye.current?ye.current.focus():it.current&&it.current.focus()})});return()=>{cancelAnimationFrame(xe),Ue.current&&clearTimeout(Ue.current),ae.current&&clearTimeout(ae.current);const qe=Te.current;qe&&document.contains(qe)&&qe.focus({preventScroll:!0})}},[]),s.useEffect(()=>{var xe;F!=="fade"&&(ke.current=((xe=de[we])==null?void 0:xe.entryIndex)??0,et(),Ee(null),Se(!1),ne(void 0),ee(void 0))},[we,et,de,F]),s.useEffect(()=>{const xe=qe=>{if(qe.key==="Escape"){tt();return}if(qe.key==="ArrowLeft"&&de.length>1){mt(we-1);return}if(qe.key==="ArrowRight"&&de.length>1){mt(we+1);return}if(qe.key==="Tab"&&it.current){const A=it.current.querySelectorAll('button:not([disabled]), [href], input:not([disabled]), select:not([disabled]), textarea:not([disabled]), [tabindex]:not([tabindex="-1"])'),se=Array.from(A).filter(gt=>!gt.closest('[aria-hidden="true"]'));if(se.length===0)return;const ge=se[0],Re=se[se.length-1],je=document.activeElement;qe.shiftKey?(je===ge||!it.current.contains(je))&&(qe.preventDefault(),Re.focus()):(je===Re||!it.current.contains(je))&&(qe.preventDefault(),ge.focus())}};return window.addEventListener("keydown",xe),()=>window.removeEventListener("keydown",xe)},[mt,tt,we,de.length]),s.useLayoutEffect(()=>{et(),W.current=0,z(0),Z(null),re(!1),Ee(null),Se(!1),ne(void 0),ee(void 0),be(null),V(xe=>{const qe=Math.max(0,de.length-1);return Math.min(xe,qe)})},[et,t.length,y,de.length]),s.useLayoutEffect(()=>{var A;const xe=Math.max(0,de.length-1),qe=Math.min(Math.max(0,l),xe);ze.current=qe,ke.current=((A=de[qe])==null?void 0:A.entryIndex)??0,V(qe)},[l]);const nt=Fe!==null?t[Fe]:null,Rt=g!==null?de[g]:null,ht=(oe==null?void 0:oe.title1)||(oe==null?void 0:oe.title2)||(oe==null?void 0:oe.title3)||(nt==null?void 0:nt.title1)||(nt==null?void 0:nt.title2)||(nt==null?void 0:nt.title3),Gt=Iv(y,de,t),Zt=L!==null,$e=ht||Gt||Zt,Ge=Gt&&Zt?{gap:Q}:void 0,ft=`${e}-titles-stack${te?` ${e}-titles-stack-stacked`:""}`,Lt=`${e}-titles-layer-out${te?` ${e}-titles-layer-out-stacked`:""}`,wt=`${e}-titles-layer-out`,vt=(K??0)>0||o,Nt=O(N),Wt=s.useMemo(()=>({title1Width:v??So.title1Width,title2Width:P??So.title2Width,title3Width:M??So.title3Width}),[v,P,M]),Dt=s.useMemo(()=>({title2MarginLeft:X,title3MarginLeft:j}),[X,j]),Me=s.useMemo(()=>oe?Ti(e,oe,k,me,C):[],[e,oe,k,me,C]),ct=s.useMemo(()=>Me.map(xe=>Wt[xe.widthKey]),[Me,Wt]),dt=s.useMemo(()=>Po(Me.length,ct),[Me.length,ct]),kt=s.useMemo(()=>vr(Me.length,ct),[Me.length,ct]),Ke=s.useMemo(()=>Me.filter(xe=>xe.prefix==="title1"),[Me]),st=s.useMemo(()=>Me.filter(xe=>xe.prefix==="title2"||xe.prefix==="title3"),[Me]),It=s.useMemo(()=>Ii(Ke,Wt),[Ke,Wt]),At=s.useMemo(()=>Ii(st,Wt),[st,Wt]),ut=s.useCallback((xe,qe)=>{const A=Me.findIndex(ge=>ge.prefix===xe.prefix);if(!te||qe==="single-row")return{effectiveWidth:kt[A]??0,resolvedWidth:dt[A]??0,maxWidth:vn(A,dt)};if(qe==="two-row-top"){const ge=Ke.findIndex(Re=>Re.prefix===xe.prefix);return{effectiveWidth:It.effective[ge]??0,resolvedWidth:It.resolved[ge]??0,maxWidth:vn(ge,It.resolved)}}const se=st.findIndex(ge=>ge.prefix===xe.prefix);return{effectiveWidth:At.effective[se]??0,resolvedWidth:At.resolved[se]??0,maxWidth:vn(se,At.resolved)}},[Me,st,At,kt,dt,Ke,It,te]),Xt=s.useCallback(xe=>sp(Me,dt,Dt,xe)+(te?0:K??0),[Me,dt,Dt,te,K]),Ut=s.useCallback(()=>te?0:K??0,[te,K]),Ot=s.useCallback(xe=>st.slice(0,xe).reduce((qe,A,se)=>qe+(A.marginLeftKey?Dt[A.marginLeftKey]??0:0)+(At.resolved[se]??0),0),[st,At.resolved,Dt]),Bt=s.useCallback(xe=>{const qe=st[xe];return Ot(xe)+(qe.marginLeftKey?Dt[qe.marginLeftKey]??0:0)+(At.resolved[xe]??0)},[st,At.resolved,Ot,Dt]),jt=s.useCallback((xe,qe,A)=>{if(!te||A==="single-row"){const gt=xe.findIndex(en=>en.prefix===qe.prefix),Ht=xe.map(en=>Wt[en.widthKey]),qt=Po(xe.length,Ht);return{effectiveWidth:vr(xe.length,Ht)[gt]??0,resolvedWidth:qt[gt]??0,maxWidth:vn(gt,qt)}}if(A==="two-row-top"){const gt=xe.filter(en=>en.prefix==="title1"),Ht=gt.findIndex(en=>en.prefix===qe.prefix),{resolved:qt,effective:sn}=Ii(gt,Wt);return{effectiveWidth:sn[Ht]??0,resolvedWidth:qt[Ht]??0,maxWidth:vn(Ht,qt)}}const se=xe.filter(gt=>gt.prefix==="title2"||gt.prefix==="title3"),ge=se.findIndex(gt=>gt.prefix===qe.prefix),{resolved:Re,effective:je}=Ii(se,Wt);return{effectiveWidth:je[ge]??0,resolvedWidth:Re[ge]??0,maxWidth:vn(ge,Re)}},[Wt,te]),zt=(xe,qe,A)=>{const se=xe.marginLeftKey?Dt[xe.marginLeftKey]??0:0,{effectiveWidth:ge,resolvedWidth:Re,maxWidth:je}=A??ut(xe,qe),gt=Math.max(se,ii),Ht=o&&qe==="two-row-top";return a.jsxs("div",{className:`${e}-title-cell`,"data-title":xe.prefix,style:{width:O(ge),...se>0?{marginLeft:O(se)}:{}},children:[a.jsx("p",{className:xe.className,style:xe.style,children:xe.text}),Ht&&xe.marginLeftKey?a.jsx("div",{"data-controls":xe.marginLeftKey,"data-controls-axis":"x","data-controls-min":"0","data-controls-max-fraction":String(Re),style:{position:"absolute",top:0,left:O(-se),width:O(gt),height:"100%",pointerEvents:"auto"}}):null,Ht?a.jsx("div",{"data-controls":xe.widthKey,"data-controls-axis":"x","data-controls-max-fraction":String(je),"data-controls-variant":"column-width",className:`${e}-title-resize-handle`,style:{position:"absolute",top:0,right:O(-Mn/2),width:O(Mn),height:"100%",pointerEvents:"auto"}}):null]},xe.className)},Kt=(xe="two-row")=>{const qe=Me.findIndex(ge=>ge.prefix==="title1"),A=qe>=0?dt[qe]:Wt.title1Width,se=xe==="two-row"&&o;return a.jsx("div",{...se?{"data-controls":"title1MarginLeft","data-controls-axis":"x","data-controls-min":"0","data-controls-max-fraction":String(A)}:{},style:{width:O(K??0),flexShrink:0,alignSelf:"stretch",...se?{pointerEvents:"auto"}:{}}})},D=()=>a.jsx("span",{className:`${e}-titles-baseline-strut`,style:k,"aria-hidden":"true",children:" "}),Le=()=>a.jsx("span",{className:`${e}-entry-counter`,style:ue,"aria-live":"polite","aria-atomic":"true",children:Tv(de,we,y,t)}),Ne=()=>Gt?o&&Zt?a.jsxs("div",{className:`${e}-text-bar-cell`,style:{flexShrink:0},children:[Le(),a.jsx("div",{"data-controls":"countCloseGap","data-controls-axis":"x","data-controls-reverse":"true",style:{position:"absolute",top:0,right:`calc(-0.5 * (${ss(Q)} + ${Q}))`,width:ss(Q),height:"100%",pointerEvents:"auto",zIndex:3}})]}):Le():null,Oe=()=>!Gt&&!Zt?null:a.jsxs("div",{className:`${e}-titles-row-header-controls`,style:Ge,children:[Ne(),Zt?Je():null]}),yt=()=>a.jsxs("div",{className:`${e}-titles-row ${e}-titles-row-header`,style:{width:"100%",position:"relative"},children:[Gt||ht?D():null,vt?Kt("single-row"):null,$t(oe),a.jsx("div",{style:{flex:1,minWidth:0},"aria-hidden":"true"}),Oe(),Sn()]}),Tt=()=>a.jsxs("div",{className:`${e}-titles-row ${e}-titles-row-header`,style:{width:"100%",position:"relative"},children:[Gt||ht?D():null,vt?Kt("single-row"):null,a.jsxs("div",{className:`${e}-titles-row-titles`,style:Ce&&B?{minHeight:B}:void 0,children:[a.jsx("div",{ref:We,className:ft,style:{position:"absolute",visibility:"hidden",pointerEvents:"none",left:0,right:0,top:0,width:"100%",height:"auto"},"aria-hidden":"true",children:bn(H||oe)}),a.jsxs("div",{ref:Qe,className:ft,style:{position:Ce?"absolute":"relative",inset:Ce?0:void 0,width:"100%",...Ce&&ce?{width:ce,maxWidth:"100%"}:void 0},children:[nt&&Ce?a.jsx("div",{className:`${Lt} ${e}-titles-fade-out`,children:bn(nt)}):null,a.jsx("div",{className:`${e}-titles-layer-in${Ce?` ${e}-titles-layer-in-fading ${e}-titles-fade-in`:""}`,children:bn(oe)})]})]}),Oe(),Sn()]}),Je=()=>a.jsxs("div",{className:`${e}-close-icon`,style:{width:b.scalingValue(Y??0,i),height:b.scalingValue(Y??0,i),marginRight:pe,"--close-icon-hover-color":I},children:[a.jsx("button",{ref:ye,type:"button",className:`${e}-close-icon-inner`,onClick:tt,"aria-label":"Close",children:a.jsx(mn,{url:L??"",fill:R,hoverFill:i&&!r?R:I,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:pe,height:"100%",pointerEvents:"auto"}})]}),Pt=(xe,qe)=>a.jsxs("div",{className:`${e}-titles-row-top`,children:[Gt||ht?D():null,vt?Kt("two-row"):null,qe!==void 0?a.jsx("div",{className:`${e}-titles-row-titles`,style:{position:"relative",flex:1,minWidth:0,minHeight:qe},children:xe}):a.jsxs(a.Fragment,{children:[xe,a.jsx("div",{style:{flex:1,minWidth:0},"aria-hidden":"true"})]}),Oe()]}),$t=xe=>{if(!xe)return null;const qe=Ti(e,xe,k,me,C);return a.jsx(a.Fragment,{children:qe.map(A=>zt(A,"single-row",jt(qe,A,"single-row")))})},_t=xe=>{if(!xe)return null;const qe=Ti(e,xe,k,me,C),A=qe.find(se=>se.prefix==="title1");return A?zt(A,"two-row-top",jt(qe,A,"two-row-top")):null},on=(xe,qe=!1)=>{const A=xe?Ti(e,xe,k,me,C):[],se=A.filter(je=>je.prefix==="title2"||je.prefix==="title3"),ge=o&&qe;return se.length>0||ge||(N??0)>0?a.jsxs("div",{className:`${e}-titles-row-bottom-wrap`,children:[se.length>0?a.jsxs("div",{className:`${e}-titles-row-bottom`,children:[se.map(je=>zt(je,"two-row-bottom",jt(A,je,"two-row-bottom"))),qe&&o?a.jsxs(a.Fragment,{children:[pi(),Yn()]}):null]}):null,(N??0)>0||ge?a.jsx("div",{"data-controls":ge?"titleRowMarginBottom":void 0,"data-controls-axis":ge?"y":void 0,"data-controls-reverse":ge?"":void 0,className:ge?`${e}-control`:void 0,style:{height:Nt,width:"100%",flexShrink:0,pointerEvents:ge?"auto":"none"}}):null]}):null},fn=(xe,qe=!1)=>a.jsxs(a.Fragment,{children:[Pt(_t(xe)),on(xe,qe)]}),bn=xe=>te?a.jsx("div",{className:`${e}-titles-row-two-row`,children:fn(xe)}):xe?a.jsx("div",{className:`${e}-titles-row`,style:{width:"100%"},children:$t(xe)}):null,ui=()=>{const xe=te?-1:Me.findIndex(se=>se.prefix==="title1"),qe=!te&&(o||(K??0)>0)?(()=>{const se=K??0,ge=xe>=0?dt[xe]:Wt.title1Width,Re=Math.max(se,ii);return a.jsx("div",{"data-controls":"title1MarginLeft","data-controls-axis":"x","data-controls-min":"0","data-controls-max-fraction":String(ge),style:{position:"absolute",top:0,left:0,width:O(Re),height:"100%",pointerEvents:"auto"}},"title1MarginLeft")})():null,A=Me.flatMap((se,ge)=>{if(!se.marginLeftKey)return[];const Re=Dt[se.marginLeftKey]??0,je=ap(Me,dt,Dt,ge)+Ut(),gt=Math.max(Re,ii);return a.jsx("div",{"data-controls":se.marginLeftKey,"data-controls-axis":"x","data-controls-min":"0","data-controls-max-fraction":String(dt[ge]),style:{position:"absolute",top:0,left:O(je),width:O(gt),height:"100%",pointerEvents:"auto"}},se.marginLeftKey)});return qe?[qe,...A]:A},dn=()=>Me.map((xe,qe)=>{const A=vn(qe,dt),ge=Xt(qe)-Mn/2;return a.jsx("div",{style:{position:"absolute",inset:0,pointerEvents:"none"},children:a.jsx("div",{"data-controls":xe.widthKey,"data-controls-axis":"x","data-controls-max-fraction":String(A),"data-controls-variant":"column-width",className:`${e}-title-resize-handle`,style:{position:"absolute",top:0,left:O(ge),width:O(Mn),height:"100%",pointerEvents:"auto"}})},`${xe.widthKey}-junction`)}),pi=()=>st.flatMap((xe,qe)=>{if(!xe.marginLeftKey)return[];const A=Dt[xe.marginLeftKey]??0,se=Ot(qe),ge=Math.max(A,ii),{resolvedWidth:Re}=ut(xe,"two-row-bottom");return a.jsx("div",{"data-controls":xe.marginLeftKey,"data-controls-axis":"x","data-controls-min":"0","data-controls-max-fraction":String(Re),style:{position:"absolute",top:0,left:O(se),width:O(ge),height:"100%",pointerEvents:"auto"}},xe.marginLeftKey)}),Yn=()=>st.map((xe,qe)=>{const{maxWidth:A}=ut(xe,"two-row-bottom"),ge=Bt(qe)-Mn/2;return a.jsx("div",{style:{position:"absolute",inset:0,pointerEvents:"none"},children:a.jsx("div",{"data-controls":xe.widthKey,"data-controls-axis":"x","data-controls-max-fraction":String(A),"data-controls-variant":"column-width",className:`${e}-title-resize-handle`,style:{position:"absolute",top:0,left:O(ge),width:O(Mn),height:"100%",pointerEvents:"auto"}})},`${xe.widthKey}-junction`)}),Sn=()=>!o||te?null:a.jsxs(a.Fragment,{children:[ui(),dn()]}),mi=xe=>{const qe=!xe.objectFit&&li(S);return{className:`${e}-slide-image-cell${qe?` ${e}-slide-image-cell-cover`:""}`,style:{maxWidth:E,maxHeight:f,...qe?{"--image-aspect-ratio":Va(S)}:{}}}},eo=xe=>xe.objectFit?{className:`${e}-slide-image ${e}-slide-image-custom`,style:{"--image-object-fit":xe.objectFit}}:li(S)?{className:`${e}-slide-image ${e}-slide-image-cover`}:{className:`${e}-slide-image ${e}-slide-image-fit`},wn=xe=>{if(xe.length===0)return null;const qe=xe.length>1,A=ss(U),se=`calc(-0.5 * (${A} + ${U}))`;if(xe.length===1){const ge=xe[0];return a.jsx("div",{...mi(ge),children:a.jsx("img",{...eo(ge),src:ge.assetId,alt:ge.name??"",draggable:!1})})}return a.jsx("div",{className:`${e}-slide-inner`,style:qe?{gap:U}:void 0,children:xe.map((ge,Re)=>a.jsxs("div",{...mi(ge),children:[a.jsx("img",{...eo(ge),src:ge.assetId,alt:ge.name??"",draggable:!1}),o&&qe&&Re<xe.length-1&&a.jsx("div",{"data-controls":"imageGap","data-controls-axis":"x",style:{position:"absolute",top:0,right:se,width:A,height:"100%",pointerEvents:"auto",zIndex:3}})]},`${ge.assetId}-${Re}`))})},Qn=!!(oe!=null&&oe.title2||oe!=null&&oe.title3||nt!=null&&nt.title2||nt!=null&&nt.title3||(N??0)>0||o),to=()=>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:We,className:ft,style:{position:"absolute",visibility:"hidden",pointerEvents:"none",left:0,right:0,top:0,width:"100%",height:"auto"},"aria-hidden":"true",children:fn(H||oe)}),a.jsxs("div",{ref:Qe,className:`${e}-titles-row-two-row`,style:{...Ce&&B?{minHeight:B}:void 0,...Ce&&ce?{width:ce,maxWidth:"100%"}:void 0},children:[Pt(a.jsxs("div",{className:ft,style:{position:Ce?"absolute":"relative",inset:Ce?0:void 0,width:"100%"},children:[nt&&Ce?a.jsx("div",{className:`${wt} ${e}-titles-fade-out`,children:_t(nt)}):null,a.jsx("div",{className:`${e}-titles-layer-in${Ce?` ${e}-titles-layer-in-fading ${e}-titles-fade-in`:""}`,children:_t(oe)})]}),Ce&&B?B:void 0),Qn?a.jsxs("div",{className:`${e}-titles-row-bottom-area`,children:[nt&&Ce?a.jsx("div",{className:`${Lt} ${e}-titles-layer-out-bottom ${e}-titles-fade-out`,children:on(nt)}):null,a.jsx("div",{className:`${e}-titles-layer-in${Ce?` ${e}-titles-layer-in-fading ${e}-titles-fade-in`:""}${te?` ${e}-titles-layer-in-stacked`:""}`,children:on(oe,!0)})]}):null]})]}),no=()=>{const xe=Qn;return a.jsxs("div",{style:{position:"relative",width:"100%",alignSelf:"stretch",display:"flex",flexDirection:"column",minHeight:0,...xe?{flex:1,height:"100%"}:{}},children:[a.jsx("div",{className:`${e}-titles-row-two-row`,style:xe?void 0:{flex:"0 0 auto",height:"auto"},children:fn(oe,!0)}),Sn()]})};return a.jsxs("div",{ref:it,"data-selection":"none",className:`${e}-lightbox${i?` ${e}-lightbox-editor`:""}${o?` ${e}-lightbox-edit-mode`:""}`,onClick:()=>{xt||tt()},role:"dialog","aria-modal":"true","aria-label":"Journal gallery",tabIndex:Zt?void 0:-1,style:{opacity:le?1:0,transition:"opacity 300ms ease",pointerEvents:le?"auto":"none"},children:[a.jsx("div",{className:`${e}-lightbox-backdrop`,style:{backgroundColor:m,...pt}}),a.jsxs("div",{className:`${e}-lightbox-dismiss-area`,style:Ae,...He,children:[a.jsx("div",{className:`${e}-lightbox-content`,style:De,onClick:xe=>xe.stopPropagation(),children:a.jsx("div",{className:`${e}-lightbox-strip`,"data-desktop-nav":fe&&de.length>1?"true":"false",onPointerDown:fe?Ct:void 0,onPointerUp:fe?rt:void 0,onPointerCancel:fe?St:void 0,children:a.jsxs("div",{className:`${e}-slide-stack`,children:[Rt&&J?a.jsx("div",{className:`${e}-slide-layer-out ${e}-slide-fade-out`,onAnimationEnd:xe=>{xe.target===xe.currentTarget&&at(he)},children:a.jsx("div",{className:`${e}-slide-area`,children:wn(Rt.images)})},`slide-out-${he}`):null,a.jsx("div",{className:`${e}-slide-layer-in${J?` ${e}-slide-fade-in`:""}`,children:a.jsx("div",{className:`${e}-slide-area`,children:ie?wn(ie.images):null})},`slide-in-${he}-${we}`)]})})}),a.jsxs("div",{className:`${e}-lightbox-overlay-content`,style:_e,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%",...te?{flex:1,minHeight:0}:{}},children:a.jsx("div",{className:`${e}-lightbox-content-area${te?` ${e}-lightbox-content-area-stacked`:""}`,children:$e&&a.jsx("div",{className:`${e}-text-bar-cell${te?` ${e}-text-bar-cell-stacked`:""}`,style:te?void 0:{flex:1,minWidth:0,width:"100%"},children:te?F==="fade"?to():no():F==="fade"?Tt():yt()})})})]})]})]})};function cb(e){return`
|
|
15612
|
+
`,tb="01M3SBP3P8CMVMM1ZZ0QVD2PPF",Di={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 nb(e){const t={};return t[Jt(e,"fontFamily")]={type:"string",scope:"common",title:"",display:{type:"font-family-select",hideLabel:!0,useTabDesign:!0}},t[Jt(e,"fontSettings")]={...Di.fontSettings,scope:"common",title:"",display:{type:"font-settings-weight",hideLabel:!0,useTabDesign:!0}},t[Jt(e,"fontSize")]={...Di.fontSize,scope:"layout",title:"",display:{type:"font-size"}},t[Jt(e,"lineHeight")]={...Di.lineHeight,scope:"layout",title:"",display:{type:"line-height-input"}},t[Jt(e,"letterSpacing")]={...Di.letterSpacing,scope:"layout",title:"",display:{type:"letter-spacing-input"}},t[Jt(e,"wordSpacing")]={...Di.wordSpacing,scope:"layout",title:"",display:{type:"word-spacing-input"}},t[Jt(e,"textAlign")]={...Di.textAlign,scope:"layout",title:"",display:{type:"vertical-text-aligh-options"}},t[Jt(e,"textAppearance")]={...Di.textAppearance,scope:"layout",title:"",display:{type:"text-appearance",useTabDesign:!0}},t}const ib=Fo.reduce((e,t)=>({...e,...nb(t)}),{}),ob=Fo.reduce((e,t)=>({...e,[Jt(t,"fontFamily")]:"Goudy Bookletter 1911",[Jt(t,"fontSettings")]:{fontWeight:400,fontStyle:"normal"},[Jt(t,"letterSpacing")]:0,[Jt(t,"wordSpacing")]:0,[Jt(t,"textAlign")]:"left",[Jt(t,"textAppearance")]:{textTransform:"none",textDecoration:"none",fontVariant:"normal"}}),{});function ys(e){return Fo.reduce((t,n)=>{const i=e[`${n}FontSize`],o=e[`${n}LineHeight`];return i!==void 0&&(t[Jt(n,"fontSize")]=i),o!==void 0&&(t[Jt(n,"lineHeight")]=o),t},{})}const rb=qx(),ab={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"}},...ib,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:"01M3QM74XESYN1HRYH9VRTZ5CK",coverFit:{display:"fit",ratioValue:"1:1",reversed:!1},closeIcon:tb,thumbnailObjectFit:{display:"fit",ratioValue:"16:9",reversed:!1},thumbnailTrigger:"click",thumbnailActive:"color",...ob},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,...ys({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,...ys({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,...ys({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:[rb]}],paletteBookmark:{items:["title1Color","title2Color","title3Color","backgroundColor","closeIconColor","closeIconHoverColor","thumbnailActiveColor"],panelIds:["general","typeStyle"]},content:{type:"array",settings:{allowsCollection:!0,addItemFromFileExplorer:!0},items:{type:"object",properties:{image:{type:"object",label:"Image",contentKey:"gallery",display:{isObjectFitEditable:!1,defaultObjectFit:"contain",type:"media-input"}},title1:{type:"string",label:"Title",contentKey:"title",placeholder:"Add Title...",display:{type:"text-input"}},title2:{type:"string",label:"Subtitle",contentKey:"subtitle",placeholder:"Add Subtitle...",display:{type:"text-input"}},title3:{type:"string",label:"Caption",placeholder:"Add Caption...",display:{type:"text-input"}}}},default:[{image:{assetId:"01M3QM74XEVZ9F59FC7M9BA63Q",name:"",objectFit:"contain"},title1:"NASA",title2:"Apollo 9 Mission, 1969",title3:"Archival Footage"},{image:{assetId:"01M3QM74XEE2101QD8PM6E4JSA",name:"",objectFit:"contain"},title1:"NASA",title2:"Apollo 9 Mission, 1969",title3:"Archival Footage"},{image:{assetId:"01M3QM74XE20C38X4NND20C5R4",name:"",objectFit:"contain"},title1:"NASA",title2:"Apollo 9 Mission, 1969",title3:"Archival Footage"},{image:{assetId:"01M3QM74XEGBJMJ7Q63KMZY6NA",name:"",objectFit:"contain"},title1:"NASA",title2:"Apollo 9 Mission, 1969",title3:"Archival Footage"},{image:{assetId:"01M3QM74XEBS5231QA4355P4VQ",name:"",objectFit:"contain"},title1:"NASA",title2:"Apollo 9 Mission, 1969",title3:"Archival Footage"},{image:{assetId:"01M3QM74XEWT5YM43KF6PEYRCV",name:"",objectFit:"contain"},title1:"NASA",title2:"Apollo 9 Mission, 1969",title3:"Archival Footage"}]}},sb={element:Jx,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:ab,sourceCode:eb,assetsPaths:{content:[{path:"image.assetId",placeholderEnabled:!0}],parameters:[{path:"cover",placeholderEnabled:!0},{path:"closeIcon"}]},fontSettingsPaths:{content:[],parameters:[...Fo.map(e=>({path:`${Jt(e,"fontFamily")}`}))]},fontRelations:{...Fo.reduce((e,t)=>({...e,[`${t}FontSettings`]:`${Jt(t,"fontFamily")}`}),{})}},lb=({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:y,coverFit:S,backgroundColor:m,imageGap:h,maxWidth:x,maxHeight:w,textTransition:F,title1Width:v,title2Width:P,title3Width:M,title1MarginLeft:K=0,title2MarginLeft:X=0,title3MarginLeft:j=0,titleRowMarginBottom:N=0,titleHeaderLayout:_="single-row",countCloseGap:T=0,closeIcon:L,closeIconMaxWidth:Y,closeIconColor:R,closeIconHoverColor:I,contentMarginTop:$=0,iconMarginRight:G=0}=n,O=s.useCallback(xe=>b.scalingValue(xe,i??!1),[i]),U=O(h??0),E=`${x}%`,f=`${w}%`,Q=O(T),q=O($),pe=O(G),k=Gi("title1",Vi(n,"title1"),i),me=Gi("title2",Vi(n,"title2"),i),C=Gi("title3",Vi(n,"title3"),i),ue=Gi("count",Vi(n,"count"),i),te=_==="mobile",fe=!i||!!r,Pe=!o&&(!i||!!r),de=s.useMemo(()=>ma(t,y),[t,y]),[we,V]=s.useState(l),ie=de[we],oe=ie==null?void 0:ie.entry,[le,ve]=s.useState(!1),[Fe,Ee]=s.useState(null),[Ce,Se]=s.useState(!1),[g,Z]=s.useState(null),[J,re]=s.useState(!1),[he,z]=s.useState(0),[B,ne]=s.useState(),[ce,ee]=s.useState(),[H,be]=s.useState(null),ae=s.useRef(null),W=s.useRef(0),ke=s.useRef(0),ze=s.useRef(0),Xe=s.useRef(!1),Ue=s.useRef(null),Qe=s.useRef(null),We=s.useRef(null),it=s.useRef(null),ye=s.useRef(null),Te=s.useRef(null),Ve=s.useRef(null),Ze=s.useCallback(()=>{const xe=Qe.current;if(!xe)return;const qe=xe.closest(`.${e}-lightbox-content-area`);if(!qe)return xe.getBoundingClientRect().width;const A=Array.from(qe.children).reduce((se,ge)=>!(ge instanceof HTMLElement)||ge.contains(xe)?se:se+ge.getBoundingClientRect().width,0);return qe.getBoundingClientRect().width-A},[e]),et=s.useCallback(()=>{ae.current&&(clearTimeout(ae.current),ae.current=null)},[]),at=s.useCallback(xe=>{xe===W.current&&(Z(null),re(!1))},[]),tt=s.useCallback(()=>{o||Xe.current||(Xe.current=!0,u==null||u(),ve(!1),Ue.current=setTimeout(()=>{p()},300))},[o,u,p]),Ye=s.useCallback(xe=>!!(xe.closest("[data-controls]")||xe.closest(`.${e}-close-icon`)),[e]),{isSwipeDragging:xt,backdropStyle:pt,mediaAreaStyle:De,overlayContentStyle:_e,swipeHandlers:He,dismissAreaStyle:Ae}=Sp({enabled:Pe,onClose:tt,animMs:300,isBlockedTarget:Ye}),Be=s.useCallback(xe=>{c&&ip(xe+1,d,!0)},[c,d]),Ie=s.useCallback(xe=>{if(xe)return xe.getBoundingClientRect().height},[]),mt=s.useCallback(xe=>{if(de.length===0)return;const qe=(xe%de.length+de.length)%de.length;if(qe===we)return;const A=de[we],se=de[qe];W.current+=1;const ge=W.current,Re=F==="fade"&&Nc(A==null?void 0:A.entry)!==Nc(se==null?void 0:se.entry),je=Ie(We.current),gt=Re?(()=>{const qt=Ze();qn.flushSync(()=>{be(se.entry)}),We.current&&qt&&(We.current.style.width=`${qt}px`);const sn=Ie(We.current);return We.current&&(We.current.style.width=""),{measuredIncomingTitlesHeight:sn,incomingTitlesMeasureWidth:qt}})():void 0,Ht=Math.max(je??0,(gt==null?void 0:gt.measuredIncomingTitlesHeight)??0)||void 0;z(ge),Z(we),re(!0),V(qe),Be(qe),ze.current=qe,Re?(et(),Ht&&ne(Ht),gt!=null&>.incomingTitlesMeasureWidth&&ee(gt.incomingTitlesMeasureWidth),Ee((A==null?void 0:A.entryIndex)??null),Se(!0),ke.current=se.entryIndex,ae.current=setTimeout(()=>{Ee(null),Se(!1),ne(void 0),ee(void 0),be(null),ae.current=null},400)):(et(),Ee(null),Se(!1),ne(void 0),ee(void 0),be(null),ke.current=se.entryIndex)},[we,et,Ze,Ie,de,Be,F]),ot=s.useCallback(()=>{Ve.current=null},[]),Ct=s.useCallback(xe=>{!fe||de.length<=1||xe.pointerType==="mouse"&&xe.button!==0||xe.target.closest("[data-controls]")||(Ve.current={startX:xe.clientX,startY:xe.clientY,pointerId:xe.pointerId})},[fe,de.length]),rt=s.useCallback(xe=>{var qt;if(!fe||de.length<=1||xe.pointerType==="mouse"&&xe.button!==0)return;if(xt){ot();return}const qe=Ve.current;if(!qe||qe.pointerId!==xe.pointerId||(ot(),xe.target.closest("[data-controls]")))return;const se=xe.clientX-qe.startX,ge=xe.clientY-qe.startY,Re=Math.abs(se),je=Math.abs(ge);if(Re>=vv&&Re>je){mt(se>0?we-1:we+1);return}if(Re>Rc||je>Rc)return;const gt=(qt=it.current)==null?void 0:qt.getBoundingClientRect(),Ht=gt?gt.left+gt.width/2:window.innerWidth/2;mt(xe.clientX<Ht?we-1:we+1)},[we,fe,mt,xt,ot,de.length]),St=s.useCallback(xe=>{const qe=Ve.current;(qe==null?void 0:qe.pointerId)===xe.pointerId&&ot()},[ot]);Vl(),s.useEffect(()=>{Te.current=document.activeElement instanceof HTMLElement?document.activeElement:null;const xe=requestAnimationFrame(()=>{ve(!0),requestAnimationFrame(()=>{ye.current?ye.current.focus():it.current&&it.current.focus()})});return()=>{cancelAnimationFrame(xe),Ue.current&&clearTimeout(Ue.current),ae.current&&clearTimeout(ae.current);const qe=Te.current;qe&&document.contains(qe)&&qe.focus({preventScroll:!0})}},[]),s.useEffect(()=>{var xe;F!=="fade"&&(ke.current=((xe=de[we])==null?void 0:xe.entryIndex)??0,et(),Ee(null),Se(!1),ne(void 0),ee(void 0))},[we,et,de,F]),s.useEffect(()=>{const xe=qe=>{if(qe.key==="Escape"){tt();return}if(qe.key==="ArrowLeft"&&de.length>1){mt(we-1);return}if(qe.key==="ArrowRight"&&de.length>1){mt(we+1);return}if(qe.key==="Tab"&&it.current){const A=it.current.querySelectorAll('button:not([disabled]), [href], input:not([disabled]), select:not([disabled]), textarea:not([disabled]), [tabindex]:not([tabindex="-1"])'),se=Array.from(A).filter(gt=>!gt.closest('[aria-hidden="true"]'));if(se.length===0)return;const ge=se[0],Re=se[se.length-1],je=document.activeElement;qe.shiftKey?(je===ge||!it.current.contains(je))&&(qe.preventDefault(),Re.focus()):(je===Re||!it.current.contains(je))&&(qe.preventDefault(),ge.focus())}};return window.addEventListener("keydown",xe),()=>window.removeEventListener("keydown",xe)},[mt,tt,we,de.length]),s.useLayoutEffect(()=>{et(),W.current=0,z(0),Z(null),re(!1),Ee(null),Se(!1),ne(void 0),ee(void 0),be(null),V(xe=>{const qe=Math.max(0,de.length-1);return Math.min(xe,qe)})},[et,t.length,y,de.length]),s.useLayoutEffect(()=>{var A;const xe=Math.max(0,de.length-1),qe=Math.min(Math.max(0,l),xe);ze.current=qe,ke.current=((A=de[qe])==null?void 0:A.entryIndex)??0,V(qe)},[l]);const nt=Fe!==null?t[Fe]:null,Rt=g!==null?de[g]:null,ht=(oe==null?void 0:oe.title1)||(oe==null?void 0:oe.title2)||(oe==null?void 0:oe.title3)||(nt==null?void 0:nt.title1)||(nt==null?void 0:nt.title2)||(nt==null?void 0:nt.title3),Vt=Iv(y,de,t),Zt=L!==null,$e=ht||Vt||Zt,Ge=Vt&&Zt?{gap:Q}:void 0,ft=`${e}-titles-stack${te?` ${e}-titles-stack-stacked`:""}`,Lt=`${e}-titles-layer-out${te?` ${e}-titles-layer-out-stacked`:""}`,wt=`${e}-titles-layer-out`,vt=(K??0)>0||o,Nt=O(N),Wt=s.useMemo(()=>({title1Width:v??So.title1Width,title2Width:P??So.title2Width,title3Width:M??So.title3Width}),[v,P,M]),Dt=s.useMemo(()=>({title2MarginLeft:X,title3MarginLeft:j}),[X,j]),Me=s.useMemo(()=>oe?Ti(e,oe,k,me,C):[],[e,oe,k,me,C]),ct=s.useMemo(()=>Me.map(xe=>Wt[xe.widthKey]),[Me,Wt]),dt=s.useMemo(()=>Po(Me.length,ct),[Me.length,ct]),kt=s.useMemo(()=>vr(Me.length,ct),[Me.length,ct]),Ke=s.useMemo(()=>Me.filter(xe=>xe.prefix==="title1"),[Me]),st=s.useMemo(()=>Me.filter(xe=>xe.prefix==="title2"||xe.prefix==="title3"),[Me]),It=s.useMemo(()=>Ii(Ke,Wt),[Ke,Wt]),At=s.useMemo(()=>Ii(st,Wt),[st,Wt]),ut=s.useCallback((xe,qe)=>{const A=Me.findIndex(ge=>ge.prefix===xe.prefix);if(!te||qe==="single-row")return{effectiveWidth:kt[A]??0,resolvedWidth:dt[A]??0,maxWidth:vn(A,dt)};if(qe==="two-row-top"){const ge=Ke.findIndex(Re=>Re.prefix===xe.prefix);return{effectiveWidth:It.effective[ge]??0,resolvedWidth:It.resolved[ge]??0,maxWidth:vn(ge,It.resolved)}}const se=st.findIndex(ge=>ge.prefix===xe.prefix);return{effectiveWidth:At.effective[se]??0,resolvedWidth:At.resolved[se]??0,maxWidth:vn(se,At.resolved)}},[Me,st,At,kt,dt,Ke,It,te]),Gt=s.useCallback(xe=>sp(Me,dt,Dt,xe)+(te?0:K??0),[Me,dt,Dt,te,K]),Ut=s.useCallback(()=>te?0:K??0,[te,K]),Ot=s.useCallback(xe=>st.slice(0,xe).reduce((qe,A,se)=>qe+(A.marginLeftKey?Dt[A.marginLeftKey]??0:0)+(At.resolved[se]??0),0),[st,At.resolved,Dt]),Bt=s.useCallback(xe=>{const qe=st[xe];return Ot(xe)+(qe.marginLeftKey?Dt[qe.marginLeftKey]??0:0)+(At.resolved[xe]??0)},[st,At.resolved,Ot,Dt]),Xt=s.useCallback((xe,qe,A)=>{if(!te||A==="single-row"){const gt=xe.findIndex(en=>en.prefix===qe.prefix),Ht=xe.map(en=>Wt[en.widthKey]),qt=Po(xe.length,Ht);return{effectiveWidth:vr(xe.length,Ht)[gt]??0,resolvedWidth:qt[gt]??0,maxWidth:vn(gt,qt)}}if(A==="two-row-top"){const gt=xe.filter(en=>en.prefix==="title1"),Ht=gt.findIndex(en=>en.prefix===qe.prefix),{resolved:qt,effective:sn}=Ii(gt,Wt);return{effectiveWidth:sn[Ht]??0,resolvedWidth:qt[Ht]??0,maxWidth:vn(Ht,qt)}}const se=xe.filter(gt=>gt.prefix==="title2"||gt.prefix==="title3"),ge=se.findIndex(gt=>gt.prefix===qe.prefix),{resolved:Re,effective:je}=Ii(se,Wt);return{effectiveWidth:je[ge]??0,resolvedWidth:Re[ge]??0,maxWidth:vn(ge,Re)}},[Wt,te]),zt=(xe,qe,A)=>{const se=xe.marginLeftKey?Dt[xe.marginLeftKey]??0:0,{effectiveWidth:ge,resolvedWidth:Re,maxWidth:je}=A??ut(xe,qe),gt=Math.max(se,ii),Ht=o&&qe==="two-row-top";return a.jsxs("div",{className:`${e}-title-cell`,"data-title":xe.prefix,style:{width:O(ge),...se>0?{marginLeft:O(se)}:{}},children:[a.jsx("p",{className:xe.className,style:xe.style,children:xe.text}),Ht&&xe.marginLeftKey?a.jsx("div",{"data-controls":xe.marginLeftKey,"data-controls-axis":"x","data-controls-min":"0","data-controls-max-fraction":String(Re),style:{position:"absolute",top:0,left:O(-se),width:O(gt),height:"100%",pointerEvents:"auto"}}):null,Ht?a.jsx("div",{"data-controls":xe.widthKey,"data-controls-axis":"x","data-controls-max-fraction":String(je),"data-controls-variant":"column-width",className:`${e}-title-resize-handle`,style:{position:"absolute",top:0,right:O(-Mn/2),width:O(Mn),height:"100%",pointerEvents:"auto"}}):null]},xe.className)},Kt=(xe="two-row")=>{const qe=Me.findIndex(ge=>ge.prefix==="title1"),A=qe>=0?dt[qe]:Wt.title1Width,se=xe==="two-row"&&o;return a.jsx("div",{...se?{"data-controls":"title1MarginLeft","data-controls-axis":"x","data-controls-min":"0","data-controls-max-fraction":String(A)}:{},style:{width:O(K??0),flexShrink:0,alignSelf:"stretch",...se?{pointerEvents:"auto"}:{}}})},D=()=>a.jsx("span",{className:`${e}-titles-baseline-strut`,style:k,"aria-hidden":"true",children:" "}),Le=()=>a.jsx("span",{className:`${e}-entry-counter`,style:ue,"aria-live":"polite","aria-atomic":"true",children:Tv(de,we,y,t)}),Ne=()=>Vt?o&&Zt?a.jsxs("div",{className:`${e}-text-bar-cell`,style:{flexShrink:0},children:[Le(),a.jsx("div",{"data-controls":"countCloseGap","data-controls-axis":"x","data-controls-reverse":"true",style:{position:"absolute",top:0,right:`calc(-0.5 * (${ss(Q)} + ${Q}))`,width:ss(Q),height:"100%",pointerEvents:"auto",zIndex:3}})]}):Le():null,Oe=()=>!Vt&&!Zt?null:a.jsxs("div",{className:`${e}-titles-row-header-controls`,style:Ge,children:[Ne(),Zt?Je():null]}),yt=()=>a.jsxs("div",{className:`${e}-titles-row ${e}-titles-row-header`,style:{width:"100%",position:"relative"},children:[Vt||ht?D():null,vt?Kt("single-row"):null,$t(oe),a.jsx("div",{style:{flex:1,minWidth:0},"aria-hidden":"true"}),Oe(),Sn()]}),Tt=()=>a.jsxs("div",{className:`${e}-titles-row ${e}-titles-row-header`,style:{width:"100%",position:"relative"},children:[Vt||ht?D():null,vt?Kt("single-row"):null,a.jsxs("div",{className:`${e}-titles-row-titles`,style:Ce&&B?{minHeight:B}:void 0,children:[a.jsx("div",{ref:We,className:ft,style:{position:"absolute",visibility:"hidden",pointerEvents:"none",left:0,right:0,top:0,width:"100%",height:"auto"},"aria-hidden":"true",children:bn(H||oe)}),a.jsxs("div",{ref:Qe,className:ft,style:{position:Ce?"absolute":"relative",inset:Ce?0:void 0,width:"100%",...Ce&&ce?{width:ce,maxWidth:"100%"}:void 0},children:[nt&&Ce?a.jsx("div",{className:`${Lt} ${e}-titles-fade-out`,children:bn(nt)}):null,a.jsx("div",{className:`${e}-titles-layer-in${Ce?` ${e}-titles-layer-in-fading ${e}-titles-fade-in`:""}`,children:bn(oe)})]})]}),Oe(),Sn()]}),Je=()=>a.jsxs("div",{className:`${e}-close-icon`,style:{width:b.scalingValue(Y??0,i),height:b.scalingValue(Y??0,i),marginRight:pe,"--close-icon-hover-color":I},children:[a.jsx("button",{ref:ye,type:"button",className:`${e}-close-icon-inner`,onClick:tt,"aria-label":"Close",children:a.jsx(mn,{url:L??"",fill:R,hoverFill:i&&!r?R:I,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:pe,height:"100%",pointerEvents:"auto"}})]}),Pt=(xe,qe)=>a.jsxs("div",{className:`${e}-titles-row-top`,children:[Vt||ht?D():null,vt?Kt("two-row"):null,qe!==void 0?a.jsx("div",{className:`${e}-titles-row-titles`,style:{position:"relative",flex:1,minWidth:0,minHeight:qe},children:xe}):a.jsxs(a.Fragment,{children:[xe,a.jsx("div",{style:{flex:1,minWidth:0},"aria-hidden":"true"})]}),Oe()]}),$t=xe=>{if(!xe)return null;const qe=Ti(e,xe,k,me,C);return a.jsx(a.Fragment,{children:qe.map(A=>zt(A,"single-row",Xt(qe,A,"single-row")))})},_t=xe=>{if(!xe)return null;const qe=Ti(e,xe,k,me,C),A=qe.find(se=>se.prefix==="title1");return A?zt(A,"two-row-top",Xt(qe,A,"two-row-top")):null},on=(xe,qe=!1)=>{const A=xe?Ti(e,xe,k,me,C):[],se=A.filter(je=>je.prefix==="title2"||je.prefix==="title3"),ge=o&&qe;return se.length>0||ge||(N??0)>0?a.jsxs("div",{className:`${e}-titles-row-bottom-wrap`,children:[se.length>0?a.jsxs("div",{className:`${e}-titles-row-bottom`,children:[se.map(je=>zt(je,"two-row-bottom",Xt(A,je,"two-row-bottom"))),qe&&o?a.jsxs(a.Fragment,{children:[pi(),Yn()]}):null]}):null,(N??0)>0||ge?a.jsx("div",{"data-controls":ge?"titleRowMarginBottom":void 0,"data-controls-axis":ge?"y":void 0,"data-controls-reverse":ge?"":void 0,className:ge?`${e}-control`:void 0,style:{height:Nt,width:"100%",flexShrink:0,pointerEvents:ge?"auto":"none"}}):null]}):null},fn=(xe,qe=!1)=>a.jsxs(a.Fragment,{children:[Pt(_t(xe)),on(xe,qe)]}),bn=xe=>te?a.jsx("div",{className:`${e}-titles-row-two-row`,children:fn(xe)}):xe?a.jsx("div",{className:`${e}-titles-row`,style:{width:"100%"},children:$t(xe)}):null,ui=()=>{const xe=te?-1:Me.findIndex(se=>se.prefix==="title1"),qe=!te&&(o||(K??0)>0)?(()=>{const se=K??0,ge=xe>=0?dt[xe]:Wt.title1Width,Re=Math.max(se,ii);return a.jsx("div",{"data-controls":"title1MarginLeft","data-controls-axis":"x","data-controls-min":"0","data-controls-max-fraction":String(ge),style:{position:"absolute",top:0,left:0,width:O(Re),height:"100%",pointerEvents:"auto"}},"title1MarginLeft")})():null,A=Me.flatMap((se,ge)=>{if(!se.marginLeftKey)return[];const Re=Dt[se.marginLeftKey]??0,je=ap(Me,dt,Dt,ge)+Ut(),gt=Math.max(Re,ii);return a.jsx("div",{"data-controls":se.marginLeftKey,"data-controls-axis":"x","data-controls-min":"0","data-controls-max-fraction":String(dt[ge]),style:{position:"absolute",top:0,left:O(je),width:O(gt),height:"100%",pointerEvents:"auto"}},se.marginLeftKey)});return qe?[qe,...A]:A},dn=()=>Me.map((xe,qe)=>{const A=vn(qe,dt),ge=Gt(qe)-Mn/2;return a.jsx("div",{style:{position:"absolute",inset:0,pointerEvents:"none"},children:a.jsx("div",{"data-controls":xe.widthKey,"data-controls-axis":"x","data-controls-max-fraction":String(A),"data-controls-variant":"column-width",className:`${e}-title-resize-handle`,style:{position:"absolute",top:0,left:O(ge),width:O(Mn),height:"100%",pointerEvents:"auto"}})},`${xe.widthKey}-junction`)}),pi=()=>st.flatMap((xe,qe)=>{if(!xe.marginLeftKey)return[];const A=Dt[xe.marginLeftKey]??0,se=Ot(qe),ge=Math.max(A,ii),{resolvedWidth:Re}=ut(xe,"two-row-bottom");return a.jsx("div",{"data-controls":xe.marginLeftKey,"data-controls-axis":"x","data-controls-min":"0","data-controls-max-fraction":String(Re),style:{position:"absolute",top:0,left:O(se),width:O(ge),height:"100%",pointerEvents:"auto"}},xe.marginLeftKey)}),Yn=()=>st.map((xe,qe)=>{const{maxWidth:A}=ut(xe,"two-row-bottom"),ge=Bt(qe)-Mn/2;return a.jsx("div",{style:{position:"absolute",inset:0,pointerEvents:"none"},children:a.jsx("div",{"data-controls":xe.widthKey,"data-controls-axis":"x","data-controls-max-fraction":String(A),"data-controls-variant":"column-width",className:`${e}-title-resize-handle`,style:{position:"absolute",top:0,left:O(ge),width:O(Mn),height:"100%",pointerEvents:"auto"}})},`${xe.widthKey}-junction`)}),Sn=()=>!o||te?null:a.jsxs(a.Fragment,{children:[ui(),dn()]}),mi=xe=>{const qe=!xe.objectFit&&li(S);return{className:`${e}-slide-image-cell${qe?` ${e}-slide-image-cell-cover`:""}`,style:{maxWidth:E,maxHeight:f,...qe?{"--image-aspect-ratio":Va(S)}:{}}}},eo=xe=>xe.objectFit?{className:`${e}-slide-image ${e}-slide-image-custom`,style:{"--image-object-fit":xe.objectFit}}:li(S)?{className:`${e}-slide-image ${e}-slide-image-cover`}:{className:`${e}-slide-image ${e}-slide-image-fit`},wn=xe=>{if(xe.length===0)return null;const qe=xe.length>1,A=ss(U),se=`calc(-0.5 * (${A} + ${U}))`;if(xe.length===1){const ge=xe[0];return a.jsx("div",{...mi(ge),children:a.jsx("img",{...eo(ge),src:ge.assetId,alt:ge.name??"",draggable:!1})})}return a.jsx("div",{className:`${e}-slide-inner`,style:qe?{gap:U}:void 0,children:xe.map((ge,Re)=>a.jsxs("div",{...mi(ge),children:[a.jsx("img",{...eo(ge),src:ge.assetId,alt:ge.name??"",draggable:!1}),o&&qe&&Re<xe.length-1&&a.jsx("div",{"data-controls":"imageGap","data-controls-axis":"x",style:{position:"absolute",top:0,right:se,width:A,height:"100%",pointerEvents:"auto",zIndex:3}})]},`${ge.assetId}-${Re}`))})},Qn=!!(oe!=null&&oe.title2||oe!=null&&oe.title3||nt!=null&&nt.title2||nt!=null&&nt.title3||(N??0)>0||o),to=()=>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:We,className:ft,style:{position:"absolute",visibility:"hidden",pointerEvents:"none",left:0,right:0,top:0,width:"100%",height:"auto"},"aria-hidden":"true",children:fn(H||oe)}),a.jsxs("div",{ref:Qe,className:`${e}-titles-row-two-row`,style:{...Ce&&B?{minHeight:B}:void 0,...Ce&&ce?{width:ce,maxWidth:"100%"}:void 0},children:[Pt(a.jsxs("div",{className:ft,style:{position:Ce?"absolute":"relative",inset:Ce?0:void 0,width:"100%"},children:[nt&&Ce?a.jsx("div",{className:`${wt} ${e}-titles-fade-out`,children:_t(nt)}):null,a.jsx("div",{className:`${e}-titles-layer-in${Ce?` ${e}-titles-layer-in-fading ${e}-titles-fade-in`:""}`,children:_t(oe)})]}),Ce&&B?B:void 0),Qn?a.jsxs("div",{className:`${e}-titles-row-bottom-area`,children:[nt&&Ce?a.jsx("div",{className:`${Lt} ${e}-titles-layer-out-bottom ${e}-titles-fade-out`,children:on(nt)}):null,a.jsx("div",{className:`${e}-titles-layer-in${Ce?` ${e}-titles-layer-in-fading ${e}-titles-fade-in`:""}${te?` ${e}-titles-layer-in-stacked`:""}`,children:on(oe,!0)})]}):null]})]}),no=()=>{const xe=Qn;return a.jsxs("div",{style:{position:"relative",width:"100%",alignSelf:"stretch",display:"flex",flexDirection:"column",minHeight:0,...xe?{flex:1,height:"100%"}:{}},children:[a.jsx("div",{className:`${e}-titles-row-two-row`,style:xe?void 0:{flex:"0 0 auto",height:"auto"},children:fn(oe,!0)}),Sn()]})};return a.jsxs("div",{ref:it,"data-selection":"none",className:`${e}-lightbox${i?` ${e}-lightbox-editor`:""}${o?` ${e}-lightbox-edit-mode`:""}`,onClick:()=>{xt||tt()},role:"dialog","aria-modal":"true","aria-label":"Journal gallery",tabIndex:Zt?void 0:-1,style:{opacity:le?1:0,transition:"opacity 300ms ease",pointerEvents:le?"auto":"none"},children:[a.jsx("div",{className:`${e}-lightbox-backdrop`,style:{backgroundColor:m,...pt}}),a.jsxs("div",{className:`${e}-lightbox-dismiss-area`,style:Ae,...He,children:[a.jsx("div",{className:`${e}-lightbox-content`,style:De,onClick:xe=>xe.stopPropagation(),children:a.jsx("div",{className:`${e}-lightbox-strip`,"data-desktop-nav":fe&&de.length>1?"true":"false",onPointerDown:fe?Ct:void 0,onPointerUp:fe?rt:void 0,onPointerCancel:fe?St:void 0,children:a.jsxs("div",{className:`${e}-slide-stack`,children:[Rt&&J?a.jsx("div",{className:`${e}-slide-layer-out ${e}-slide-fade-out`,onAnimationEnd:xe=>{xe.target===xe.currentTarget&&at(he)},children:a.jsx("div",{className:`${e}-slide-area`,children:wn(Rt.images)})},`slide-out-${he}`):null,a.jsx("div",{className:`${e}-slide-layer-in${J?` ${e}-slide-fade-in`:""}`,children:a.jsx("div",{className:`${e}-slide-area`,children:ie?wn(ie.images):null})},`slide-in-${he}-${we}`)]})})}),a.jsxs("div",{className:`${e}-lightbox-overlay-content`,style:_e,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%",...te?{flex:1,minHeight:0}:{}},children:a.jsx("div",{className:`${e}-lightbox-content-area${te?` ${e}-lightbox-content-area-stacked`:""}`,children:$e&&a.jsx("div",{className:`${e}-text-bar-cell${te?` ${e}-text-bar-cell-stacked`:""}`,style:te?void 0:{flex:1,minWidth:0,width:"100%"},children:te?F==="fade"?to():no():F==="fade"?Tt():yt()})})})]})]})]})};function cb(e){return`
|
|
15617
15613
|
.${e}-wrapper {
|
|
15618
15614
|
position: relative;
|
|
15619
15615
|
width: 100%;
|
|
@@ -19162,7 +19158,7 @@ export function SimpleButton({ settings, isEditor, isPreviewMode, activeEvent, h
|
|
|
19162
19158
|
pointer-events: auto;
|
|
19163
19159
|
flex-shrink: 0;
|
|
19164
19160
|
}
|
|
19165
|
-
`}const Dn=500,Qo=650,Tn="cubic-bezier(0.22, 1, 0.36, 1)",Zb=72,Jb=50,eS=1e4,tS=650,nS=500;function iS(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 Tp(e,t){if(t==="contain"&&e instanceof HTMLImageElement){const i=wa(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 oS(e,t,n){const i=e.querySelector(`[data-waterfall-index="${t}"]`);return i instanceof HTMLElement?Tp(i,n):null}function rS(e){return e.reduce((t,n,i)=>{var o;return(o=n.image)!=null&&o.assetId&&t.push({gridIndex:i,items:[n.image],entry:{title1:n.title??"",title2:n.subtitle??"",title3:n.caption??""}}),t},[])}function or(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 md(e,t,n){if(e.length<=2)return null;const i=(t+n+e.length)%e.length;return or(e,i,n)}const aS=.03;function Ip(e){return e.width*aS}const Ss={left:0,top:0,width:typeof window<"u"?window.innerWidth:1440,height:typeof window<"u"?window.innerHeight:900};function Kr(e,t){return{left:e.left-t.left,top:e.top-t.top,width:e.width,height:e.height}}function gd(e){const t=e.getBoundingClientRect();return{width:t.width,height:t.height,left:t.left,top:t.top}}function sS(e){return e instanceof HTMLVideoElement?{width:e.videoWidth,height:e.videoHeight}:{width:e.naturalWidth,height:e.naturalHeight}}function Ks(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 lS(e,t){return!e||!(t!=null&&t.width)||!(t!=null&&t.height)?null:Ks(e,t.width,t.height)}function cS(e,t){if(b.isEmbedMedia(e)){t(e.assetId,b.getEmbedAspect(e),1);return}if(Ga(e)){const i=document.createElement("video"),o=()=>{i.videoWidth>0&&i.videoHeight>0&&t(e.assetId,i.videoWidth,i.videoHeight),i.removeEventListener("loadedmetadata",o)};i.addEventListener("loadedmetadata",o),i.preload="auto",i.src=e.assetId,i.load();return}const n=new Image;n.onload=()=>{n.naturalWidth>0&&n.naturalHeight>0&&t(e.assetId,n.naturalWidth,n.naturalHeight)},n.src=e.assetId}function dS(e){const t=new Set,n=[];for(const i of e){const o=i.image;!(o!=null&&o.assetId)||t.has(o.assetId)||(t.add(o.assetId),n.push(o))}return n}function uS({mediaList:e}){const t=e.filter(n=>!b.isEmbedMedia(n));return t.length===0?null:a.jsx("div",{"aria-hidden":!0,style:{position:"absolute",width:0,height:0,overflow:"hidden",opacity:0,pointerEvents:"none"},children:t.map(n=>Ga(n)?a.jsx("video",{src:n.assetId,preload:"auto",muted:!0,playsInline:!0},n.assetId):a.jsx("img",{src:n.assetId,alt:""},n.assetId))})}function No(e,t,n){const{width:i,height:o,top:r}=e,{left:l,width:c}=n,d=Ip(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 Ia(e,t,n){const i=No(e,t,n);return{...i,left:2*i.left-e.left}}function pS(e,t,n){const{left:i,width:o}=n,r=Ip(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 Lp(e,t,n,i){const o=No(e,"left",i),r=No(e,"right",i),l=Ia(e,"left",i),c=Ia(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 mS(e,t,n,i){const{start:o,end:r}=Lp(e,t,n,i);return{x:r.left-o.left,y:r.top-o.top}}function gS(e,t,n){const i=No(e,t,n),o=Ia(e,t,n);return{x:o.left-i.left,y:o.top-i.top}}function Ga(e){return b.isEmbedMedia(e)?!1:e.type==="video"?!0:/\.(mp4|webm|ogg|mov)(\?|#|$)/i.test(e.assetId)}function hS({src:e,onMediaElement:t,wrapperStyle:n,videoStyle:i,onLoadedMetadata:o,onTransitionEnd:r}){const l=s.useRef(null);return s.useEffect(()=>{const c=l.current;return t==null||t(c??null),()=>{c==null||c.pause(),t==null||t(null)}},[e,t]),a.jsx("div",{style:n,onTransitionEnd:r,children:a.jsx("video",{ref:l,src:e,muted:!0,autoPlay:!0,loop:!0,playsInline:!0,preload:"auto",onLoadedMetadata:o,style:i},e)})}function Yr({media:e,style:t,onTransitionEnd:n,onMeasure:i}){return b.isEmbedMedia(e)?a.jsx("img",{src:e.thumbnail,alt:e.name,style:t,onTransitionEnd:n}):Ga(e)?a.jsx("video",{src:e.assetId,muted:!0,autoPlay:!0,loop:!0,playsInline:!0,preload:"auto",style:t,onLoadedMetadata:o=>{const r=o.currentTarget;r.videoWidth>0&&r.videoHeight>0&&(i==null||i(e.assetId,r.videoWidth,r.videoHeight))},onTransitionEnd:n}):a.jsx("img",{src:e.assetId,alt:e.name,style:t,onLoad:o=>{const r=o.currentTarget;r.naturalWidth>0&&r.naturalHeight>0&&(i==null||i(e.assetId,r.naturalWidth,r.naturalHeight))},onTransitionEnd:n})}function fS({prefix:e,items:t,index:n,entry:i,settings:o,isEditor:r,isEditMode:l,isPreviewMode:c,canNavigate:d,lightboxEntries:u,entryIdx:p,layoutId:y,sourceRect:S,resolveCloseSourceRect:m,onClose:h,onPrev:x,onNext:w}){const F=s.useRef(null),v=s.useRef(null),P=s.useRef(null),M=s.useRef(new Map),[K,X]=s.useState(0),j=s.useRef(null),N=s.useRef(0),_=s.useRef(0),T=s.useRef("none"),L=s.useRef(!1),Y=s.useRef(!1),R=s.useRef(!1),I=s.useRef(null),$=s.useRef(null),G=s.useRef(null),O=s.useRef(()=>{}),U=s.useRef(null),E=s.useRef(null),f=s.useRef(null),Q=s.useRef(!1),[q,pe]=s.useState(null),[k,me]=s.useState(Ss),[C,ue]=s.useState(0),[te,fe]=s.useState("opening"),[Pe,de]=s.useState(0),[we,V]=s.useState(0),[ie,oe]=s.useState(!1),[le,ve]=s.useState(null),[Fe,Ee]=s.useState(null),[Ce,Se]=s.useState(null),[g,Z]=s.useState(!1),[J,re]=s.useState(null),[he,z]=s.useState(!1),B=s.useRef(!1),[ne,ce]=s.useState(!1),[ee,H]=s.useState(!1),be=s.useRef(n),ae=s.useRef(void 0),W=t[n],ke=W?Ga(W):!1,ze=W?b.isEmbedMedia(W):!1,Xe=we!==0||ie,Ue=!l&&(!r||!!c),Qe=d&&!l,We=u.length>1,it=s.useCallback((D,Le)=>t.length<=1?null:t[(D+Le+t.length)%t.length]??null,[t]),ye=We?or(u,p,-1):it(n,-1),Te=We?or(u,p,1):it(n,1),Ve=le===-1&&Xe?We&&Fe!==null?or(u,Fe,-1):Ce!==null?it(Ce,-1):null:null,Ze=le===1&&Xe?We&&Fe!==null?or(u,Fe,1):Ce!==null?it(Ce,1):null:null,et=Ve&&Ve.assetId!==(ye==null?void 0:ye.assetId)?Ve:null,at=Ze&&Ze.assetId!==(Te==null?void 0:Te.assetId)?Ze:null,tt=ye&&Qe?(()=>{const D=We?md(u,p,-1):t.length>2?it((n-1+t.length)%t.length,-1):null;return D&&D.assetId!==ye.assetId?D:null})():null,Ye=Te&&Qe?(()=>{const D=We?md(u,p,1):t.length>2?it((n+1)%t.length,1):null;return D&&D.assetId!==Te.assetId?D:null})():null,xt=et??tt,pt=at??Ye,De=s.useCallback((D,Le,Ne)=>{if(!D||!Le||!Ne)return;const Oe=M.current,yt=Oe.get(D);(yt==null?void 0:yt.width)===Le&&(yt==null?void 0:yt.height)===Ne||(Oe.set(D,{width:Le,height:Ne}),X(Tt=>Tt+1))},[]),_e=s.useCallback(D=>{if(!(D!=null&&D.assetId))return null;const Le=M.current.get(D.assetId);return lS(v.current,Le)},[K,C]),He=s.useCallback(()=>{if(!W)return;const D=_e(W);if(D){pe(D);return}const Le=v.current;Le&&pe(gd(Le))},[W,_e]),Ae=s.useCallback(D=>{if(We){const Le=u.length;Ee((p+D+Le)%Le),Se(null);return}t.length>1&&(Se((n+D+t.length)%t.length),Ee(null))},[We,u.length,p,t.length,n]),Be=s.useCallback(D=>{R.current=D,oe(D)},[]),Ie=s.useCallback(()=>{I.current!==null&&(window.clearTimeout(I.current),I.current=null)},[]),mt=s.useCallback(()=>{Ie(),I.current=window.setTimeout(()=>{Ie(),Be(!1)},Qo+32)},[Ie,Be]),ot=s.useCallback(()=>{const D=F.current;if(!D){me({left:0,top:0,width:typeof window<"u"?window.innerWidth:Ss.width,height:typeof window<"u"?window.innerHeight:Ss.height});return}const Le=D.getBoundingClientRect();me({left:Le.left,top:Le.top,width:Le.width,height:Le.height})},[]),Ct=s.useCallback((D,Le)=>{if(Xe){if(ne&&!ie)return`translate(${we}px, 0px)`;if(ie&&le!==null){const Ne=_e(D);if(!Ne)return;const{x:Oe,y:yt}=mS(Ne,Le,le,k);return`translate(${Oe}px, ${yt}px)`}if(ie)return"translate(0px, 0px)"}},[Xe,ne,ie,we,le,k,_e]),rt=s.useCallback(()=>{const D=$.current;$.current=null,Ie(),Be(!1),ve(null),Ee(null),Se(null),V(0),ce(!1),L.current=!1,_.current=0,T.current="none",D===-1?x():D===1&&w()},[Ie,Be,x,w]),St=s.useCallback(()=>{Ie(),I.current=window.setTimeout(()=>{$.current!==null&&rt()},Qo+32)},[Ie,rt]),nt=s.useCallback(()=>{Ie(),$.current=null,Be(!1),ve(null),Ee(null),Se(null),V(0),ce(!1),L.current=!1,_.current=0,T.current="none"},[Ie,Be]),Rt=s.useCallback(D=>{if(!(!Qe||!q)){if(R.current){if($.current===D){G.current=D,rt();return}nt()}Ie(),Ae(D),$.current=D,ve(D),Be(!0),St()}},[Qe,q,rt,nt,Ie,Ae,Be,St]);O.current=Rt;const ht=s.useCallback(()=>{U.current=null,Q.current=!1,E.current!==null&&(window.clearInterval(E.current),E.current=null),f.current!==null&&(window.clearTimeout(f.current),f.current=null)},[]),Gt=s.useCallback(D=>{E.current!==null&&window.clearInterval(E.current);const Le=Q.current?nS:tS;E.current=window.setInterval(()=>{O.current(D)},Le)},[]),Zt=s.useCallback(D=>{U.current!==D&&(ht(),U.current=D,Q.current=!1,O.current(D),Gt(D),f.current=window.setTimeout(()=>{f.current=null,U.current===D&&(Q.current=!0,Gt(D))},eS))},[ht,Gt]),$e=s.useCallback(()=>{const D=v.current;if(!D)return;const Le=W==null?void 0:W.assetId,Ne=Le?M.current.get(Le):void 0;if(Ne!=null&&Ne.width&&(Ne!=null&&Ne.height)){pe(Ks(D,Ne.width,Ne.height));return}const Oe=P.current;if(Oe&&Le&&(Oe.src===Le||Oe.currentSrc===Le)){const{width:Tt,height:Je}=sS(Oe);if(Tt&&Je){De(Le,Tt,Je),pe(Ks(D,Tt,Je));return}}const yt=gd(D);!yt.width||!yt.height||pe(yt)},[W==null?void 0:W.assetId,De]),Ge=s.useCallback(D=>{if(P.current=D,!!D){if(D instanceof HTMLVideoElement){D.readyState>=1&&D.videoWidth>0&&$e();return}D.complete&&D.naturalWidth>0&&$e()}},[$e]),ft=s.useCallback(()=>{ot(),$e(),ue(D=>D+1)},[ot,$e]);s.useEffect(()=>{ft();const D=v.current,Le=F.current,Ne=new ResizeObserver(()=>ft());return D&&Ne.observe(D),Le&&Ne.observe(Le),window.addEventListener("resize",ft),()=>{Ne.disconnect(),window.removeEventListener("resize",ft)}},[ft,n,y]),s.useLayoutEffect(()=>{if(!W)return;const D=P.current;if(D){if(D instanceof HTMLImageElement&&D.complete&&D.naturalWidth>0){$e();return}D instanceof HTMLVideoElement&&D.readyState>=1&&D.videoWidth>0&&$e()}},[W==null?void 0:W.assetId,n,$e]),s.useEffect(()=>{He()},[He,K]),s.useEffect(()=>{const D=new Set,Le=[],Ne=Oe=>{!(Oe!=null&&Oe.assetId)||D.has(Oe.assetId)||(D.add(Oe.assetId),Le.push(Oe))};t.forEach(Ne),u.forEach(Oe=>Oe.items.forEach(Ne)),Le.forEach(Oe=>{M.current.has(Oe.assetId)||cS(Oe,De)})},[t,u,De]),s.useEffect(()=>{if(te!=="opening"||!q)return;if(!S){fe("open");return}Z(!1);const D=requestAnimationFrame(()=>{requestAnimationFrame(()=>{Z(!0),fe("open")})});return()=>cancelAnimationFrame(D)},[te,q,S]),s.useEffect(()=>{if(te!=="closing")return;const D=setTimeout(()=>h(),Dn);return()=>clearTimeout(D)},[te,h]),s.useEffect(()=>()=>{Ie()},[Ie]),s.useLayoutEffect(()=>{be.current===n&&ae.current===(W==null?void 0:W.assetId)||(Ie(),$.current=null,ve(null),Ee(null),Se(null),de(0),V(0),Be(!1),H(!1),ce(!1),N.current=0,_.current=0,T.current="none",L.current=!1,j.current=null,Y.current=!1,P.current=null,He(),be.current=n,ae.current=W==null?void 0:W.assetId)},[n,W==null?void 0:W.assetId,Be,Ie,He]),s.useLayoutEffect(()=>{const D=G.current;D!==null&&(G.current=null,requestAnimationFrame(()=>{O.current(D)}))},[n,p,W==null?void 0:W.assetId]),s.useLayoutEffect(()=>{if(te==="opening"){B.current=!1,z(!1);return}if(te!=="open"||B.current)return;if(!ye&&!Te){B.current=!0;return}z(!1);const D=requestAnimationFrame(()=>{requestAnimationFrame(()=>{z(!0),B.current=!0})});return()=>cancelAnimationFrame(D)},[te,ye==null?void 0:ye.assetId,Te==null?void 0:Te.assetId]),s.useEffect(()=>{if(te!=="open")return;const D=()=>{const Je=Pt=>{Pt.stopPropagation(),Pt.preventDefault(),document.removeEventListener("click",Je,!0)};document.addEventListener("click",Je,!0)},Le=Je=>{const Pt=Je<0?1:-1;Ie(),Ae(Pt),$.current=Pt,ve(Pt),Be(!0),St()},Ne=Je=>{if(Math.abs(Je)>Jb&&Qe){Le(Je);return}$.current=null,ve(null),Ee(null),Se(null),Be(!0),V(0),mt()},Oe=Je=>{if(Je.touches.length!==1||R.current)return;const Pt=Je.touches[0];Y.current=!0,j.current={x:Pt.clientX,y:Pt.clientY},T.current="none",_.current=0,L.current=!1},yt=Je=>{if(!j.current||Je.touches.length!==1||R.current)return;const Pt=Je.touches[0],$t=Pt.clientX-j.current.x,_t=Pt.clientY-j.current.y;if(T.current==="none"){if(Math.abs($t)<10&&Math.abs(_t)<10)return;if(Math.abs($t)>Math.abs(_t)){if(!Qe)return;T.current="horizontal"}else if(_t>0){if(!Ue)return;T.current="vertical"}else return}if(T.current==="horizontal"){L.current=!0,ce(!0),_.current=$t,V($t),Je.preventDefault();return}T.current==="vertical"&&(L.current=!0,ce(!0),N.current=_t,de(_t),Je.preventDefault())},Tt=()=>{if(!j.current)return;const Je=T.current,Pt=L.current;if(Pt&&Je==="horizontal")Ne(_.current),D();else if(Pt&&Je==="vertical"){const $t=N.current;if(Ue&&$t>Zb){const _t=window.innerHeight;N.current=_t,H(!0),de(_t),fe("closing")}else N.current=0,de(0);D()}else Je==="horizontal"&&Math.abs(_.current)>0&&(Ne(_.current),D());j.current=null,T.current="none",_.current=0,L.current=!1,ce(!1)};return document.addEventListener("touchstart",Oe,{passive:!0}),document.addEventListener("touchmove",yt,{passive:!1}),document.addEventListener("touchend",Tt),document.addEventListener("touchcancel",Tt),()=>{document.removeEventListener("touchstart",Oe),document.removeEventListener("touchmove",yt),document.removeEventListener("touchend",Tt),document.removeEventListener("touchcancel",Tt)}},[te,Qe,Be,mt,Ie,Ue,St,Ae]);const Lt=s.useCallback(()=>{const D=(m==null?void 0:m())??S??null;D&&q&&(re(D),Z(!0)),fe("closing")},[m,S,q]);s.useEffect(()=>{const D=Oe=>{if(Oe.key==="Escape"){if(r&&c||te==="closing")return;ht(),Lt();return}if(Oe.key!=="ArrowLeft"&&Oe.key!=="ArrowRight"||te!=="open"||!Qe)return;Oe.preventDefault();const yt=Oe.key==="ArrowLeft"?-1:1;Oe.repeat&&U.current===yt||Zt(yt)},Le=Oe=>{if(Oe.key!=="ArrowLeft"&&Oe.key!=="ArrowRight")return;const yt=Oe.key==="ArrowLeft"?-1:1;U.current===yt&&ht()},Ne=()=>{ht()};return window.addEventListener("keydown",D),window.addEventListener("keyup",Le),window.addEventListener("blur",Ne),()=>{window.removeEventListener("keydown",D),window.removeEventListener("keyup",Le),window.removeEventListener("blur",Ne),ht()}},[te,r,c,Lt,Qe,Zt,ht]),s.useEffect(()=>{te!=="open"&&ht()},[te,ht]);const wt=()=>{te==="closing"||l||Lt()},vt=te==="open",Nt=te==="closing",Wt=Pe>0?Math.max(0,1-Pe/500):1,Dt=Pe>0?Math.max(.35,1-Pe/500):1,Me=s.useCallback(D=>{if(!(D.propertyName!=="transform"||!R.current)){if($.current!==null){rt();return}Ie(),Be(!1)}},[Ie,Be,rt]),ct=te==="closing"?J??S:S,dt=ct&&q&&(te==="opening"||Nt)?iS(ct,q):void 0,kt=Xe&&W?Ct(W,"center"):Pe>0?`translateY(${Pe}px)`:dt,Ke=q?Kr(q,k):null,st=!!(ct&&q),It=st&&(te==="closing"||te==="open"&&g),At={position:"absolute",top:Ke==null?void 0:Ke.top,left:Ke==null?void 0:Ke.left,width:Ke==null?void 0:Ke.width,height:Ke==null?void 0:Ke.height,objectFit:"contain",transformOrigin:"top left",transform:kt,opacity:Pe>0?Dt:st?1:te==="opening"||Nt?0:1,transition:ne&&!ie?"none":ie?`transform ${Qo}ms ${Tn}`:ee?`transform ${Dn}ms ${Tn}, opacity ${Dn}ms ${Tn}`:It?`transform ${Dn}ms ${Tn}`:te==="opening"||Nt?`opacity ${Dn}ms ${Tn}`:"none",pointerEvents:"none",zIndex:1,overflow:ke||ze?"hidden":void 0},ut={width:"100%",height:"100%",display:"block",objectFit:"contain",pointerEvents:"none"},Xt=(D,Le,Ne="adjacent")=>{const Oe=_e(D);if(!Oe)return{display:"none"};const yt=Ne==="far"?Le==="left"?"far-left":"far-right":Le==="left"?"left-adjacent":"right-adjacent",{start:Tt}=le!==null?Lp(Oe,yt,le,k):{start:Ne==="far"?Ia(Oe,Le,k):No(Oe,Le,k)},Je=Kr(Tt,k),Pt=Ct(D,yt),$t=!Xe&&Ne==="adjacent"&&vt&&!he?gS(Oe,Le,k):null,_t=Ne==="far"&&Xe&&le===(Le==="left"?-1:1),on=ne&&!ie?!1:ie,fn=Ne==="adjacent"&&vt&&he&&!Xe;return{position:"absolute",top:Je.top,left:Je.left,width:Je.width,height:Je.height,objectFit:"contain",transform:Pt??($t?`translate(${$t.x}px, ${$t.y}px)`:void 0),opacity:Ne==="far"?vt&&_t?1:0:vt?1:0,transition:on?Ne==="far"?`transform ${Qo}ms ${Tn}`:`transform ${Qo}ms ${Tn}, opacity ${Dn}ms ${Tn}`:fn?`transform ${Dn}ms ${Tn}`:te==="opening"||Nt?`opacity ${Dn}ms ${Tn}`:"none",pointerEvents:"none",zIndex:1}},Ut=(D,Le)=>{const Ne=_e(D);return Ne?pS(No(Ne,Le,k),Le,k):null},Ot=D=>Le=>{if(!l){if(Y.current){Y.current=!1;return}Le.stopPropagation(),Rt(D)}},Bt=ye?Ut(ye,"left"):null,jt=Te?Ut(Te,"right"):null,zt=Bt?Kr(Bt,k):null,Kt=jt?Kr(jt,k):null;return a.jsxs("div",{ref:F,className:[`${e}-lightbox`,r?`${e}-lightbox-editor`:"",l?`${e}-lightbox-edit-mode`:""].filter(Boolean).join(" "),style:{touchAction:te==="open"?"none":void 0},onClick:wt,children:[a.jsx("div",{style:{position:"absolute",inset:0,background:o.backgroundColor??"#FFFFFF",opacity:vt?Wt:0,transition:ne?"none":`opacity ${Dn}ms ${Tn}`,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:v,style:{width:"100%",height:"100%"}})}),a.jsx("div",{style:{height:"10%"}})]}),a.jsx("div",{style:{position:"absolute",inset:0,opacity:vt?1:0,transition:ne?"none":`opacity ${Dn}ms ${Tn}`,pointerEvents:"none"},children:a.jsx(lp,{prefix:e,entry:i,settings:o,isEditor:r,isEditMode:l,isPreviewMode:c,onClose:wt})})]}),vt&&xt&&a.jsx(Yr,{media:xt,style:Xt(xt,"left","far"),onMeasure:De,onTransitionEnd:Me},`far-prev-${xt.assetId}`),vt&&ye&&a.jsxs(a.Fragment,{children:[a.jsx(Yr,{media:ye,style:Xt(ye,"left"),onMeasure:De,onTransitionEnd:Me},`prev-${ye.assetId}`),zt&&a.jsx("div",{style:{position:"absolute",top:zt.top,left:zt.left,width:zt.width,height:zt.height,cursor:l||ne?"default":"pointer",pointerEvents:l||ne?"none":"auto",zIndex:3},onClick:Ot(-1)})]}),vt&&Te&&a.jsxs(a.Fragment,{children:[a.jsx(Yr,{media:Te,style:Xt(Te,"right"),onMeasure:De,onTransitionEnd:Me},`next-${Te.assetId}`),Kt&&a.jsx("div",{style:{position:"absolute",top:Kt.top,left:Kt.left,width:Kt.width,height:Kt.height,cursor:l||ne?"default":"pointer",pointerEvents:l||ne?"none":"auto",zIndex:3},onClick:Ot(1)})]}),vt&&pt&&a.jsx(Yr,{media:pt,style:Xt(pt,"right","far"),onMeasure:De,onTransitionEnd:Me},`far-next-${pt.assetId}`),q&&W&&(ze?a.jsx("div",{style:At,onTransitionEnd:Me,children:a.jsx(b.EmbedMediaFrame,{media:W,fit:"contain",lazy:!1,startsAtOnce:!0,style:ut})},`${n}-${W.assetId}`):ke?a.jsx(hS,{src:W.assetId,onMediaElement:Ge,wrapperStyle:At,videoStyle:ut,onLoadedMetadata:$e,onTransitionEnd:Me},`${n}-${W.assetId}`):a.jsx("img",{ref:Ge,src:W.assetId,alt:W.name,onLoad:$e,onTransitionEnd:Me,style:At},`${n}-${W.assetId}`))]})}const yS=20,vS=.18;function xS(e){return`
|
|
19161
|
+
`}const Dn=500,Qo=650,Tn="cubic-bezier(0.22, 1, 0.36, 1)",Zb=72,Jb=50,eS=1e4,tS=650,nS=500;function iS(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 Tp(e,t){if(t==="contain"&&e instanceof HTMLImageElement){const i=wa(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 oS(e,t,n){const i=e.querySelector(`[data-waterfall-index="${t}"]`);return i instanceof HTMLElement?Tp(i,n):null}function rS(e){return e.reduce((t,n,i)=>{var o;return(o=n.image)!=null&&o.assetId&&t.push({gridIndex:i,items:[n.image],entry:{title1:n.title??"",title2:n.subtitle??"",title3:n.caption??""}}),t},[])}function or(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 md(e,t,n){if(e.length<=2)return null;const i=(t+n+e.length)%e.length;return or(e,i,n)}const aS=.03;function Ip(e){return e.width*aS}const Ss={left:0,top:0,width:typeof window<"u"?window.innerWidth:1440,height:typeof window<"u"?window.innerHeight:900};function Kr(e,t){return{left:e.left-t.left,top:e.top-t.top,width:e.width,height:e.height}}function gd(e){const t=e.getBoundingClientRect();return{width:t.width,height:t.height,left:t.left,top:t.top}}function sS(e){return e instanceof HTMLVideoElement?{width:e.videoWidth,height:e.videoHeight}:{width:e.naturalWidth,height:e.naturalHeight}}function Ks(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 lS(e,t){return!e||!(t!=null&&t.width)||!(t!=null&&t.height)?null:Ks(e,t.width,t.height)}function cS(e,t){if(b.isEmbedMedia(e)){t(e.assetId,b.getEmbedAspect(e),1);return}if(Ga(e)){const i=document.createElement("video"),o=()=>{i.videoWidth>0&&i.videoHeight>0&&t(e.assetId,i.videoWidth,i.videoHeight),i.removeEventListener("loadedmetadata",o)};i.addEventListener("loadedmetadata",o),i.preload="auto",i.src=e.assetId,i.load();return}const n=new Image;n.onload=()=>{n.naturalWidth>0&&n.naturalHeight>0&&t(e.assetId,n.naturalWidth,n.naturalHeight)},n.src=e.assetId}function dS(e){const t=new Set,n=[];for(const i of e){const o=i.image;!(o!=null&&o.assetId)||t.has(o.assetId)||(t.add(o.assetId),n.push(o))}return n}function uS({mediaList:e}){const t=e.filter(n=>!b.isEmbedMedia(n));return t.length===0?null:a.jsx("div",{"aria-hidden":!0,style:{position:"absolute",width:0,height:0,overflow:"hidden",opacity:0,pointerEvents:"none"},children:t.map(n=>Ga(n)?a.jsx("video",{src:n.assetId,preload:"auto",muted:!0,playsInline:!0},n.assetId):a.jsx("img",{src:n.assetId,alt:""},n.assetId))})}function No(e,t,n){const{width:i,height:o,top:r}=e,{left:l,width:c}=n,d=Ip(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 Ia(e,t,n){const i=No(e,t,n);return{...i,left:2*i.left-e.left}}function pS(e,t,n){const{left:i,width:o}=n,r=Ip(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 Lp(e,t,n,i){const o=No(e,"left",i),r=No(e,"right",i),l=Ia(e,"left",i),c=Ia(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 mS(e,t,n,i){const{start:o,end:r}=Lp(e,t,n,i);return{x:r.left-o.left,y:r.top-o.top}}function gS(e,t,n){const i=No(e,t,n),o=Ia(e,t,n);return{x:o.left-i.left,y:o.top-i.top}}function Ga(e){return b.isEmbedMedia(e)?!1:e.type==="video"?!0:/\.(mp4|webm|ogg|mov)(\?|#|$)/i.test(e.assetId)}function hS({src:e,onMediaElement:t,wrapperStyle:n,videoStyle:i,onLoadedMetadata:o,onTransitionEnd:r}){const l=s.useRef(null);return s.useEffect(()=>{const c=l.current;return t==null||t(c??null),()=>{c==null||c.pause(),t==null||t(null)}},[e,t]),a.jsx("div",{style:n,onTransitionEnd:r,children:a.jsx("video",{ref:l,src:e,muted:!0,autoPlay:!0,loop:!0,playsInline:!0,preload:"auto",onLoadedMetadata:o,style:i},e)})}function Yr({media:e,style:t,onTransitionEnd:n,onMeasure:i}){return b.isEmbedMedia(e)?a.jsx("img",{src:e.thumbnail,alt:e.name,style:t,onTransitionEnd:n}):Ga(e)?a.jsx("video",{src:e.assetId,muted:!0,autoPlay:!0,loop:!0,playsInline:!0,preload:"auto",style:t,onLoadedMetadata:o=>{const r=o.currentTarget;r.videoWidth>0&&r.videoHeight>0&&(i==null||i(e.assetId,r.videoWidth,r.videoHeight))},onTransitionEnd:n}):a.jsx("img",{src:e.assetId,alt:e.name,style:t,onLoad:o=>{const r=o.currentTarget;r.naturalWidth>0&&r.naturalHeight>0&&(i==null||i(e.assetId,r.naturalWidth,r.naturalHeight))},onTransitionEnd:n})}function fS({prefix:e,items:t,index:n,entry:i,settings:o,isEditor:r,isEditMode:l,isPreviewMode:c,canNavigate:d,lightboxEntries:u,entryIdx:p,layoutId:y,sourceRect:S,resolveCloseSourceRect:m,onClose:h,onPrev:x,onNext:w}){const F=s.useRef(null),v=s.useRef(null),P=s.useRef(null),M=s.useRef(new Map),[K,X]=s.useState(0),j=s.useRef(null),N=s.useRef(0),_=s.useRef(0),T=s.useRef("none"),L=s.useRef(!1),Y=s.useRef(!1),R=s.useRef(!1),I=s.useRef(null),$=s.useRef(null),G=s.useRef(null),O=s.useRef(()=>{}),U=s.useRef(null),E=s.useRef(null),f=s.useRef(null),Q=s.useRef(!1),[q,pe]=s.useState(null),[k,me]=s.useState(Ss),[C,ue]=s.useState(0),[te,fe]=s.useState("opening"),[Pe,de]=s.useState(0),[we,V]=s.useState(0),[ie,oe]=s.useState(!1),[le,ve]=s.useState(null),[Fe,Ee]=s.useState(null),[Ce,Se]=s.useState(null),[g,Z]=s.useState(!1),[J,re]=s.useState(null),[he,z]=s.useState(!1),B=s.useRef(!1),[ne,ce]=s.useState(!1),[ee,H]=s.useState(!1),be=s.useRef(n),ae=s.useRef(void 0),W=t[n],ke=W?Ga(W):!1,ze=W?b.isEmbedMedia(W):!1,Xe=we!==0||ie,Ue=!l&&(!r||!!c),Qe=d&&!l,We=u.length>1,it=s.useCallback((D,Le)=>t.length<=1?null:t[(D+Le+t.length)%t.length]??null,[t]),ye=We?or(u,p,-1):it(n,-1),Te=We?or(u,p,1):it(n,1),Ve=le===-1&&Xe?We&&Fe!==null?or(u,Fe,-1):Ce!==null?it(Ce,-1):null:null,Ze=le===1&&Xe?We&&Fe!==null?or(u,Fe,1):Ce!==null?it(Ce,1):null:null,et=Ve&&Ve.assetId!==(ye==null?void 0:ye.assetId)?Ve:null,at=Ze&&Ze.assetId!==(Te==null?void 0:Te.assetId)?Ze:null,tt=ye&&Qe?(()=>{const D=We?md(u,p,-1):t.length>2?it((n-1+t.length)%t.length,-1):null;return D&&D.assetId!==ye.assetId?D:null})():null,Ye=Te&&Qe?(()=>{const D=We?md(u,p,1):t.length>2?it((n+1)%t.length,1):null;return D&&D.assetId!==Te.assetId?D:null})():null,xt=et??tt,pt=at??Ye,De=s.useCallback((D,Le,Ne)=>{if(!D||!Le||!Ne)return;const Oe=M.current,yt=Oe.get(D);(yt==null?void 0:yt.width)===Le&&(yt==null?void 0:yt.height)===Ne||(Oe.set(D,{width:Le,height:Ne}),X(Tt=>Tt+1))},[]),_e=s.useCallback(D=>{if(!(D!=null&&D.assetId))return null;const Le=M.current.get(D.assetId);return lS(v.current,Le)},[K,C]),He=s.useCallback(()=>{if(!W)return;const D=_e(W);if(D){pe(D);return}const Le=v.current;Le&&pe(gd(Le))},[W,_e]),Ae=s.useCallback(D=>{if(We){const Le=u.length;Ee((p+D+Le)%Le),Se(null);return}t.length>1&&(Se((n+D+t.length)%t.length),Ee(null))},[We,u.length,p,t.length,n]),Be=s.useCallback(D=>{R.current=D,oe(D)},[]),Ie=s.useCallback(()=>{I.current!==null&&(window.clearTimeout(I.current),I.current=null)},[]),mt=s.useCallback(()=>{Ie(),I.current=window.setTimeout(()=>{Ie(),Be(!1)},Qo+32)},[Ie,Be]),ot=s.useCallback(()=>{const D=F.current;if(!D){me({left:0,top:0,width:typeof window<"u"?window.innerWidth:Ss.width,height:typeof window<"u"?window.innerHeight:Ss.height});return}const Le=D.getBoundingClientRect();me({left:Le.left,top:Le.top,width:Le.width,height:Le.height})},[]),Ct=s.useCallback((D,Le)=>{if(Xe){if(ne&&!ie)return`translate(${we}px, 0px)`;if(ie&&le!==null){const Ne=_e(D);if(!Ne)return;const{x:Oe,y:yt}=mS(Ne,Le,le,k);return`translate(${Oe}px, ${yt}px)`}if(ie)return"translate(0px, 0px)"}},[Xe,ne,ie,we,le,k,_e]),rt=s.useCallback(()=>{const D=$.current;$.current=null,Ie(),Be(!1),ve(null),Ee(null),Se(null),V(0),ce(!1),L.current=!1,_.current=0,T.current="none",D===-1?x():D===1&&w()},[Ie,Be,x,w]),St=s.useCallback(()=>{Ie(),I.current=window.setTimeout(()=>{$.current!==null&&rt()},Qo+32)},[Ie,rt]),nt=s.useCallback(()=>{Ie(),$.current=null,Be(!1),ve(null),Ee(null),Se(null),V(0),ce(!1),L.current=!1,_.current=0,T.current="none"},[Ie,Be]),Rt=s.useCallback(D=>{if(!(!Qe||!q)){if(R.current){if($.current===D){G.current=D,rt();return}nt()}Ie(),Ae(D),$.current=D,ve(D),Be(!0),St()}},[Qe,q,rt,nt,Ie,Ae,Be,St]);O.current=Rt;const ht=s.useCallback(()=>{U.current=null,Q.current=!1,E.current!==null&&(window.clearInterval(E.current),E.current=null),f.current!==null&&(window.clearTimeout(f.current),f.current=null)},[]),Vt=s.useCallback(D=>{E.current!==null&&window.clearInterval(E.current);const Le=Q.current?nS:tS;E.current=window.setInterval(()=>{O.current(D)},Le)},[]),Zt=s.useCallback(D=>{U.current!==D&&(ht(),U.current=D,Q.current=!1,O.current(D),Vt(D),f.current=window.setTimeout(()=>{f.current=null,U.current===D&&(Q.current=!0,Vt(D))},eS))},[ht,Vt]),$e=s.useCallback(()=>{const D=v.current;if(!D)return;const Le=W==null?void 0:W.assetId,Ne=Le?M.current.get(Le):void 0;if(Ne!=null&&Ne.width&&(Ne!=null&&Ne.height)){pe(Ks(D,Ne.width,Ne.height));return}const Oe=P.current;if(Oe&&Le&&(Oe.src===Le||Oe.currentSrc===Le)){const{width:Tt,height:Je}=sS(Oe);if(Tt&&Je){De(Le,Tt,Je),pe(Ks(D,Tt,Je));return}}const yt=gd(D);!yt.width||!yt.height||pe(yt)},[W==null?void 0:W.assetId,De]),Ge=s.useCallback(D=>{if(P.current=D,!!D){if(D instanceof HTMLVideoElement){D.readyState>=1&&D.videoWidth>0&&$e();return}D.complete&&D.naturalWidth>0&&$e()}},[$e]),ft=s.useCallback(()=>{ot(),$e(),ue(D=>D+1)},[ot,$e]);s.useEffect(()=>{ft();const D=v.current,Le=F.current,Ne=new ResizeObserver(()=>ft());return D&&Ne.observe(D),Le&&Ne.observe(Le),window.addEventListener("resize",ft),()=>{Ne.disconnect(),window.removeEventListener("resize",ft)}},[ft,n,y]),s.useLayoutEffect(()=>{if(!W)return;const D=P.current;if(D){if(D instanceof HTMLImageElement&&D.complete&&D.naturalWidth>0){$e();return}D instanceof HTMLVideoElement&&D.readyState>=1&&D.videoWidth>0&&$e()}},[W==null?void 0:W.assetId,n,$e]),s.useEffect(()=>{He()},[He,K]),s.useEffect(()=>{const D=new Set,Le=[],Ne=Oe=>{!(Oe!=null&&Oe.assetId)||D.has(Oe.assetId)||(D.add(Oe.assetId),Le.push(Oe))};t.forEach(Ne),u.forEach(Oe=>Oe.items.forEach(Ne)),Le.forEach(Oe=>{M.current.has(Oe.assetId)||cS(Oe,De)})},[t,u,De]),s.useEffect(()=>{if(te!=="opening"||!q)return;if(!S){fe("open");return}Z(!1);const D=requestAnimationFrame(()=>{requestAnimationFrame(()=>{Z(!0),fe("open")})});return()=>cancelAnimationFrame(D)},[te,q,S]),s.useEffect(()=>{if(te!=="closing")return;const D=setTimeout(()=>h(),Dn);return()=>clearTimeout(D)},[te,h]),s.useEffect(()=>()=>{Ie()},[Ie]),s.useLayoutEffect(()=>{be.current===n&&ae.current===(W==null?void 0:W.assetId)||(Ie(),$.current=null,ve(null),Ee(null),Se(null),de(0),V(0),Be(!1),H(!1),ce(!1),N.current=0,_.current=0,T.current="none",L.current=!1,j.current=null,Y.current=!1,P.current=null,He(),be.current=n,ae.current=W==null?void 0:W.assetId)},[n,W==null?void 0:W.assetId,Be,Ie,He]),s.useLayoutEffect(()=>{const D=G.current;D!==null&&(G.current=null,requestAnimationFrame(()=>{O.current(D)}))},[n,p,W==null?void 0:W.assetId]),s.useLayoutEffect(()=>{if(te==="opening"){B.current=!1,z(!1);return}if(te!=="open"||B.current)return;if(!ye&&!Te){B.current=!0;return}z(!1);const D=requestAnimationFrame(()=>{requestAnimationFrame(()=>{z(!0),B.current=!0})});return()=>cancelAnimationFrame(D)},[te,ye==null?void 0:ye.assetId,Te==null?void 0:Te.assetId]),s.useEffect(()=>{if(te!=="open")return;const D=()=>{const Je=Pt=>{Pt.stopPropagation(),Pt.preventDefault(),document.removeEventListener("click",Je,!0)};document.addEventListener("click",Je,!0)},Le=Je=>{const Pt=Je<0?1:-1;Ie(),Ae(Pt),$.current=Pt,ve(Pt),Be(!0),St()},Ne=Je=>{if(Math.abs(Je)>Jb&&Qe){Le(Je);return}$.current=null,ve(null),Ee(null),Se(null),Be(!0),V(0),mt()},Oe=Je=>{if(Je.touches.length!==1||R.current)return;const Pt=Je.touches[0];Y.current=!0,j.current={x:Pt.clientX,y:Pt.clientY},T.current="none",_.current=0,L.current=!1},yt=Je=>{if(!j.current||Je.touches.length!==1||R.current)return;const Pt=Je.touches[0],$t=Pt.clientX-j.current.x,_t=Pt.clientY-j.current.y;if(T.current==="none"){if(Math.abs($t)<10&&Math.abs(_t)<10)return;if(Math.abs($t)>Math.abs(_t)){if(!Qe)return;T.current="horizontal"}else if(_t>0){if(!Ue)return;T.current="vertical"}else return}if(T.current==="horizontal"){L.current=!0,ce(!0),_.current=$t,V($t),Je.preventDefault();return}T.current==="vertical"&&(L.current=!0,ce(!0),N.current=_t,de(_t),Je.preventDefault())},Tt=()=>{if(!j.current)return;const Je=T.current,Pt=L.current;if(Pt&&Je==="horizontal")Ne(_.current),D();else if(Pt&&Je==="vertical"){const $t=N.current;if(Ue&&$t>Zb){const _t=window.innerHeight;N.current=_t,H(!0),de(_t),fe("closing")}else N.current=0,de(0);D()}else Je==="horizontal"&&Math.abs(_.current)>0&&(Ne(_.current),D());j.current=null,T.current="none",_.current=0,L.current=!1,ce(!1)};return document.addEventListener("touchstart",Oe,{passive:!0}),document.addEventListener("touchmove",yt,{passive:!1}),document.addEventListener("touchend",Tt),document.addEventListener("touchcancel",Tt),()=>{document.removeEventListener("touchstart",Oe),document.removeEventListener("touchmove",yt),document.removeEventListener("touchend",Tt),document.removeEventListener("touchcancel",Tt)}},[te,Qe,Be,mt,Ie,Ue,St,Ae]);const Lt=s.useCallback(()=>{const D=(m==null?void 0:m())??S??null;D&&q&&(re(D),Z(!0)),fe("closing")},[m,S,q]);s.useEffect(()=>{const D=Oe=>{if(Oe.key==="Escape"){if(r&&c||te==="closing")return;ht(),Lt();return}if(Oe.key!=="ArrowLeft"&&Oe.key!=="ArrowRight"||te!=="open"||!Qe)return;Oe.preventDefault();const yt=Oe.key==="ArrowLeft"?-1:1;Oe.repeat&&U.current===yt||Zt(yt)},Le=Oe=>{if(Oe.key!=="ArrowLeft"&&Oe.key!=="ArrowRight")return;const yt=Oe.key==="ArrowLeft"?-1:1;U.current===yt&&ht()},Ne=()=>{ht()};return window.addEventListener("keydown",D),window.addEventListener("keyup",Le),window.addEventListener("blur",Ne),()=>{window.removeEventListener("keydown",D),window.removeEventListener("keyup",Le),window.removeEventListener("blur",Ne),ht()}},[te,r,c,Lt,Qe,Zt,ht]),s.useEffect(()=>{te!=="open"&&ht()},[te,ht]);const wt=()=>{te==="closing"||l||Lt()},vt=te==="open",Nt=te==="closing",Wt=Pe>0?Math.max(0,1-Pe/500):1,Dt=Pe>0?Math.max(.35,1-Pe/500):1,Me=s.useCallback(D=>{if(!(D.propertyName!=="transform"||!R.current)){if($.current!==null){rt();return}Ie(),Be(!1)}},[Ie,Be,rt]),ct=te==="closing"?J??S:S,dt=ct&&q&&(te==="opening"||Nt)?iS(ct,q):void 0,kt=Xe&&W?Ct(W,"center"):Pe>0?`translateY(${Pe}px)`:dt,Ke=q?Kr(q,k):null,st=!!(ct&&q),It=st&&(te==="closing"||te==="open"&&g),At={position:"absolute",top:Ke==null?void 0:Ke.top,left:Ke==null?void 0:Ke.left,width:Ke==null?void 0:Ke.width,height:Ke==null?void 0:Ke.height,objectFit:"contain",transformOrigin:"top left",transform:kt,opacity:Pe>0?Dt:st?1:te==="opening"||Nt?0:1,transition:ne&&!ie?"none":ie?`transform ${Qo}ms ${Tn}`:ee?`transform ${Dn}ms ${Tn}, opacity ${Dn}ms ${Tn}`:It?`transform ${Dn}ms ${Tn}`:te==="opening"||Nt?`opacity ${Dn}ms ${Tn}`:"none",pointerEvents:"none",zIndex:1,overflow:ke||ze?"hidden":void 0},ut={width:"100%",height:"100%",display:"block",objectFit:"contain",pointerEvents:"none"},Gt=(D,Le,Ne="adjacent")=>{const Oe=_e(D);if(!Oe)return{display:"none"};const yt=Ne==="far"?Le==="left"?"far-left":"far-right":Le==="left"?"left-adjacent":"right-adjacent",{start:Tt}=le!==null?Lp(Oe,yt,le,k):{start:Ne==="far"?Ia(Oe,Le,k):No(Oe,Le,k)},Je=Kr(Tt,k),Pt=Ct(D,yt),$t=!Xe&&Ne==="adjacent"&&vt&&!he?gS(Oe,Le,k):null,_t=Ne==="far"&&Xe&&le===(Le==="left"?-1:1),on=ne&&!ie?!1:ie,fn=Ne==="adjacent"&&vt&&he&&!Xe;return{position:"absolute",top:Je.top,left:Je.left,width:Je.width,height:Je.height,objectFit:"contain",transform:Pt??($t?`translate(${$t.x}px, ${$t.y}px)`:void 0),opacity:Ne==="far"?vt&&_t?1:0:vt?1:0,transition:on?Ne==="far"?`transform ${Qo}ms ${Tn}`:`transform ${Qo}ms ${Tn}, opacity ${Dn}ms ${Tn}`:fn?`transform ${Dn}ms ${Tn}`:te==="opening"||Nt?`opacity ${Dn}ms ${Tn}`:"none",pointerEvents:"none",zIndex:1}},Ut=(D,Le)=>{const Ne=_e(D);return Ne?pS(No(Ne,Le,k),Le,k):null},Ot=D=>Le=>{if(!l){if(Y.current){Y.current=!1;return}Le.stopPropagation(),Rt(D)}},Bt=ye?Ut(ye,"left"):null,Xt=Te?Ut(Te,"right"):null,zt=Bt?Kr(Bt,k):null,Kt=Xt?Kr(Xt,k):null;return a.jsxs("div",{ref:F,className:[`${e}-lightbox`,r?`${e}-lightbox-editor`:"",l?`${e}-lightbox-edit-mode`:""].filter(Boolean).join(" "),style:{touchAction:te==="open"?"none":void 0},onClick:wt,children:[a.jsx("div",{style:{position:"absolute",inset:0,background:o.backgroundColor??"#FFFFFF",opacity:vt?Wt:0,transition:ne?"none":`opacity ${Dn}ms ${Tn}`,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:v,style:{width:"100%",height:"100%"}})}),a.jsx("div",{style:{height:"10%"}})]}),a.jsx("div",{style:{position:"absolute",inset:0,opacity:vt?1:0,transition:ne?"none":`opacity ${Dn}ms ${Tn}`,pointerEvents:"none"},children:a.jsx(lp,{prefix:e,entry:i,settings:o,isEditor:r,isEditMode:l,isPreviewMode:c,onClose:wt})})]}),vt&&xt&&a.jsx(Yr,{media:xt,style:Gt(xt,"left","far"),onMeasure:De,onTransitionEnd:Me},`far-prev-${xt.assetId}`),vt&&ye&&a.jsxs(a.Fragment,{children:[a.jsx(Yr,{media:ye,style:Gt(ye,"left"),onMeasure:De,onTransitionEnd:Me},`prev-${ye.assetId}`),zt&&a.jsx("div",{style:{position:"absolute",top:zt.top,left:zt.left,width:zt.width,height:zt.height,cursor:l||ne?"default":"pointer",pointerEvents:l||ne?"none":"auto",zIndex:3},onClick:Ot(-1)})]}),vt&&Te&&a.jsxs(a.Fragment,{children:[a.jsx(Yr,{media:Te,style:Gt(Te,"right"),onMeasure:De,onTransitionEnd:Me},`next-${Te.assetId}`),Kt&&a.jsx("div",{style:{position:"absolute",top:Kt.top,left:Kt.left,width:Kt.width,height:Kt.height,cursor:l||ne?"default":"pointer",pointerEvents:l||ne?"none":"auto",zIndex:3},onClick:Ot(1)})]}),vt&&pt&&a.jsx(Yr,{media:pt,style:Gt(pt,"right","far"),onMeasure:De,onTransitionEnd:Me},`far-next-${pt.assetId}`),q&&W&&(ze?a.jsx("div",{style:At,onTransitionEnd:Me,children:a.jsx(b.EmbedMediaFrame,{media:W,fit:"contain",lazy:!1,startsAtOnce:!0,style:ut})},`${n}-${W.assetId}`):ke?a.jsx(hS,{src:W.assetId,onMediaElement:Ge,wrapperStyle:At,videoStyle:ut,onLoadedMetadata:$e,onTransitionEnd:Me},`${n}-${W.assetId}`):a.jsx("img",{ref:Ge,src:W.assetId,alt:W.name,onLoad:$e,onTransitionEnd:Me,style:At},`${n}-${W.assetId}`))]})}const yS=20,vS=.18;function xS(e){return`
|
|
19166
19162
|
.${e}-wrapper {
|
|
19167
19163
|
box-sizing: border-box;
|
|
19168
19164
|
max-width: 100%;
|
|
@@ -21502,7 +21498,7 @@ function ArrowIcon({ color, className }: { color: string, className: string }) {
|
|
|
21502
21498
|
left: 50%;
|
|
21503
21499
|
transform: translate(-50%, -50%);
|
|
21504
21500
|
}
|
|
21505
|
-
`}const Mp={"left-top":{horizontal:"left",vertical:"top"},"top-center":{horizontal:"center",vertical:"top"},"top-right":{horizontal:"right",vertical:"top"},"left-center":{horizontal:"left",vertical:"center"},center:{horizontal:"center",vertical:"center"},"right-center":{horizontal:"right",vertical:"center"},"left-bottom":{horizontal:"left",vertical:"bottom"},"bottom-center":{horizontal:"center",vertical:"bottom"},"right-bottom":{horizontal:"right",vertical:"bottom"}};function nw(e){return e in Mp}function iw(e){if(e&&nw(e))return e;switch(e){case"center-top":return"top-center";case"right-top":return"top-right";case"top-left":return"left-top";case"center-bottom":return"bottom-center";case"bottom-left":return"left-bottom";case"bottom-right":return"right-bottom";case"center-center":return"center";case"left":return"left-center";case"right":return"right-center";case"top":return"left-top";default:return"center"}}function Xl(e){return Mp[e]}const ow="rgba(28,31,34,0.9)",Jn=500,Bi="cubic-bezier(0.22, 1, 0.36, 1)",rw=72,aw=50,sw={titleColor:"title-color",descriptionColor:"description-color",lightboxCounterColor:"lightbox-counter-color"},lw=[];function cw(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 dw(e){const[t,n]=e.media;return n!=null&&n.assetId?n:t!=null&&t.assetId?t:null}function uw(e){const[t]=e.media;return t!=null&&t.assetId?t:null}function pw(e){if(!Array.isArray(e)||e.length===0)return[];if(cw(e)){const t=[];for(const n of e){const i=dw(n);if(!i)continue;const o=uw(n);t.push({displayMedia:i,lightboxMedia:o!=null&&o.assetId?o:null})}return t}return e.filter(t=>t==null?void 0:t.assetId).map(t=>({displayMedia:t,lightboxMedia:t}))}function Ys(e){return e.type==="video"}function mw(e){e.pause(),e.removeAttribute("src"),e.load()}function Zr(e){const t=e.getBoundingClientRect();return{width:t.width,height:t.height,left:t.left,top:t.top}}function gw(e){return e instanceof HTMLVideoElement?{width:e.videoWidth,height:e.videoHeight}:{width:e.naturalWidth,height:e.naturalHeight}}const hw=1140/1440;function fw(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 yw(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 vw(e){return typeof e=="string"?e==="cover"?"cover":"fit":(e==null?void 0:e.display)==="cover"?"cover":"fit"}function xw({src:e,mediaRef:t,mediaStyle:n,onLoadedMetadata:i,onTransitionEnd:o}){return s.useEffect(()=>{const r=t.current;if(r)return()=>{mw(r)}},[e,t]),a.jsx("video",{ref:t,src:e,muted:!0,autoPlay:!0,loop:!0,playsInline:!0,preload:"auto",onLoadedMetadata:i,onTransitionEnd:o,style:n})}const bw="https://cdn.cntrl.site/component-assets/defaultCloseIcon.svg",Sw=.004;function ww({prefix:e,closeIcon:t=bw,closeIconMaxWidth:n=.0125,closeIconColor:i="#FFFFFF",closeIconHoverColor:o="#999999",iconMarginRight:r=.01,contentMarginTop:l=.01,isEditor:c,isPreviewMode:d,isEditMode:u,visible:p,onClose:y}){if(!t)return null;const S=b.scalingValue(n,c),m=b.scalingValue(r,c),h=b.scalingValue(l,c),x=b.scalingValue(Math.max(l,Sw),c);return a.jsxs("div",{style:{position:"absolute",top:0,left:0,right:0,zIndex:1e4,display:"flex",flexDirection:"column",alignItems:"flex-end",pointerEvents:"none",opacity:p?1:0,transition:"opacity 500ms cubic-bezier(0.22, 1, 0.36, 1)"},children:[a.jsx("div",{style:{position:"relative",width:"100%",height:h,flexShrink:0},children:u&&a.jsx("div",{"data-controls":"contentMarginTop","data-controls-axis":"y","data-controls-min":"0",className:`${e}-control`,style:{position:"absolute",top:0,left:0,width:"100%",height:x,pointerEvents:p?"auto":"none"}})}),a.jsxs("div",{className:`${e}-close-icon`,style:{width:S,height:S,marginRight:m,pointerEvents:p?"auto":"none"},onClick:w=>w.stopPropagation(),children:[a.jsx("button",{type:"button",className:`${e}-close-icon-inner`,"aria-label":"Close",onClick:w=>{w.stopPropagation(),y()},children:a.jsx(mn,{url:t,fill:i,hoverFill:c&&!d?i:o,className:`${e}-close-icon-img`})}),u&&a.jsx("div",{"data-controls":"iconMarginRight","data-controls-axis":"x","data-controls-reverse":"",className:`${e}-control`,style:{position:"absolute",top:0,left:"100%",width:m,height:"100%",pointerEvents:p?"auto":"none"}})]})]})}function $w({prefix:e,items:t,index:n,imageDisplay:i,isEditor:o,isPreviewMode:r,isEditMode:l,onClose:c,onPrev:d,onNext:u,counterClassName:p,counterStyle:y,backgroundColor:S,closeIcon:m,closeIconMaxWidth:h,closeIconColor:x,closeIconHoverColor:w,iconMarginRight:F,contentMarginTop:v}){const P=i==="cover",M=s.useRef(null),K=s.useRef(null),X=s.useRef(null),j=s.useRef(0),N=s.useRef(0),_=s.useRef("none"),T=s.useRef(!1),L=s.useRef(!1),Y=s.useRef(!1),R=s.useRef(null),[I,$]=s.useState(null),[G,O]=s.useState("opening"),[U,E]=s.useState(0),[f,Q]=s.useState(0),[q,pe]=s.useState(!1),[k,me]=s.useState(!1),[C,ue]=s.useState(!1),te=s.useRef(n),fe=t[n],Pe=fe?Ys(fe):!1,de=fe?b.isEmbedMedia(fe):!1,we=f!==0||q,V=s.useCallback(z=>{Y.current=z,pe(z)},[]),ie=s.useCallback(()=>{R.current!==null&&(window.clearTimeout(R.current),R.current=null)},[]),oe=s.useCallback(()=>{ie(),R.current=window.setTimeout(()=>{ie(),V(!1)},Jn+32)},[ie,V]),le=s.useCallback(()=>{const z=M.current,B=K.current;if(!z)return;const ne=z.getBoundingClientRect(),ce=ne.width,ee=ne.height;if(!ce||!ee)return;if(i==="cover"){$({width:ce,height:ee,left:ne.left,top:ne.top});return}let H=fe&&b.isEmbedMedia(fe)?b.getEmbedAspect(fe):null;if(H===null){if(!B){$(Zr(z));return}const{width:ae,height:W}=gw(B);if(!ae||!W){$(Zr(z));return}H=ae/W}const be=ce/ee;if(H>be){const ae=ce/H;$({width:ce,height:ae,left:ne.left,top:ne.top+(ee-ae)/2})}else{const ae=ee*H;$({width:ae,height:ee,left:ne.left+(ce-ae)/2,top:ne.top})}},[i,fe]);s.useEffect(()=>{le();const z=M.current;if(!z)return;const B=new ResizeObserver(()=>le());return B.observe(z),()=>B.disconnect()},[le,n]),s.useEffect(()=>{G==="opening"&&I&&O("open")},[G,I]),s.useEffect(()=>{if(G!=="closing")return;const z=setTimeout(()=>c(),Jn);return()=>clearTimeout(z)},[G,c]),s.useEffect(()=>()=>{ie()},[ie]),s.useLayoutEffect(()=>{if(te.current===n)return;ie(),E(0),Q(0),V(!1),ue(!1),me(!1),j.current=0,N.current=0,_.current="none",T.current=!1,X.current=null,L.current=!1;const z=M.current;z&&$(Zr(z)),te.current=n},[n,V,ie]),s.useEffect(()=>{if(G!=="open")return;let z=null;const B=()=>{z&&(document.removeEventListener("click",z,!0),z=null)},ne=()=>{B(),z=W=>{W.stopPropagation(),W.preventDefault(),B()},document.addEventListener("click",z,!0)},ce=W=>{ie(),Y.current=!1,pe(!1),Q(0),me(!1),T.current=!1,N.current=0,_.current="none";const ke=M.current;ke&&$(Zr(ke)),W<0?u():d()},ee=W=>{if(Math.abs(W)>aw&&t.length>1){ce(W);return}V(!0),Q(0),oe()},H=W=>{if(W.touches.length!==1||Y.current)return;const ke=W.touches[0];L.current=!0,X.current={x:ke.clientX,y:ke.clientY},_.current="none",N.current=0,T.current=!1},be=W=>{if(!X.current||W.touches.length!==1||Y.current)return;const ke=W.touches[0],ze=ke.clientX-X.current.x,Xe=ke.clientY-X.current.y;if(_.current==="none"){if(Math.abs(ze)<10&&Math.abs(Xe)<10)return;if(Math.abs(ze)>Math.abs(Xe)){if(t.length<=1)return;_.current="horizontal"}else if(Xe>0)_.current="vertical";else return}if(_.current==="horizontal"){T.current=!0,me(!0),N.current=ze,Q(ze),W.preventDefault();return}_.current==="vertical"&&(T.current=!0,me(!0),j.current=Xe,E(Xe),W.preventDefault())},ae=()=>{if(!X.current)return;const W=_.current,ke=T.current;if(ke&&W==="horizontal")ee(N.current),ne();else if(ke&&W==="vertical")if(j.current>rw){const Xe=window.innerHeight;j.current=Xe,ue(!0),E(Xe),O("closing")}else j.current=0,E(0),ne();else W==="horizontal"&&Math.abs(N.current)>0&&(ee(N.current),ne());X.current=null,_.current="none",N.current=0,T.current=!1,me(!1)};return document.addEventListener("touchstart",H,{passive:!0}),document.addEventListener("touchmove",be,{passive:!1}),document.addEventListener("touchend",ae),document.addEventListener("touchcancel",ae),()=>{document.removeEventListener("touchstart",H),document.removeEventListener("touchmove",be),document.removeEventListener("touchend",ae),document.removeEventListener("touchcancel",ae),B()}},[G,t.length,u,d,V,oe,ie]),s.useEffect(()=>{const z=B=>{B.key==="Escape"&&(B.preventDefault(),B.stopPropagation(),G!=="closing"&&O("closing"))};return window.addEventListener("keydown",z,!0),()=>window.removeEventListener("keydown",z,!0)},[G]);const ve=()=>{G!=="closing"&&O("closing")},Fe=G==="open",Ee=G==="closing",Ce=U>0?Math.max(0,1-U/500):1,Se=U>0?Math.max(.35,1-U/500):1,g=s.useCallback(z=>{z.propertyName!=="transform"||!Y.current||(ie(),V(!1))},[ie,V]),Z=we?`translateX(${f}px)`:U>0?`translateY(${U}px)`:void 0,J={position:"fixed",top:I==null?void 0:I.top,left:I==null?void 0:I.left,width:I==null?void 0:I.width,height:I==null?void 0:I.height,objectFit:i==="cover"?"cover":"contain",transform:Z,opacity:U>0?Se:G==="opening"||Ee?0:1,transition:k&&!q?"none":q?`transform ${Jn}ms ${Bi}`:C?`transform ${Jn}ms ${Bi}, opacity ${Jn}ms ${Bi}`:G==="opening"||Ee?`opacity ${Jn}ms ${Bi}`:"none",pointerEvents:"none",zIndex:9998},re=de&&fe&&b.getEmbedPlayback(fe).controls&&I?Math.min(52,I.height*.2):0,he=I?{position:"fixed",top:I.top,height:I.height-re,width:I.width/2,zIndex:9999}:null;return a.jsxs("div",{className:[`${e}-lightbox`,o?`${e}-lightbox-editor`:""].filter(Boolean).join(" "),style:{touchAction:G==="open"?"none":void 0},onClick:ve,children:[a.jsx("div",{style:{position:"absolute",inset:0,background:S,opacity:Fe?Ce:0,transition:k?"none":`opacity ${Jn}ms ${Bi}`,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:M,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:Fe?1:0,transition:`opacity ${Jn}ms ${Bi}`,pointerEvents:"none",zIndex:9999},children:t.length>1&&a.jsxs("p",{className:p,style:y,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:M,style:{width:"100%",height:"100%"}})}),a.jsx("div",{style:{display:"flex",flexDirection:"row",justifyContent:"center",alignItems:"center",height:"10%",opacity:Fe?1:0,transition:`opacity ${Jn}ms ${Bi}`},children:t.length>1&&a.jsxs("p",{className:p,style:y,children:[n+1," / ",t.length]})})]})}),I&&fe&&(de?a.jsx(b.EmbedMediaFrame,{media:fe,fit:i==="cover"?"cover":"contain",lazy:!1,startsAtOnce:!0,style:J,onTransitionEnd:g},`${n}-${fe.assetId}`):Pe?a.jsx(xw,{src:fe.assetId,mediaRef:K,mediaStyle:J,onLoadedMetadata:le,onTransitionEnd:g},`${n}-${fe.assetId}`):a.jsx("img",{ref:K,src:fe.assetId,alt:fe.name,onLoad:le,onTransitionEnd:g,style:J},`${n}-${fe.assetId}`)),Fe&&he&&t.length>1&&a.jsxs(a.Fragment,{children:[a.jsx("div",{style:{...he,left:I.left,cursor:"w-resize",pointerEvents:we?"none":"auto"},onClick:z=>{if(L.current){L.current=!1;return}z.stopPropagation(),d()}}),a.jsx("div",{style:{...he,left:I.left+I.width/2,cursor:"e-resize",pointerEvents:we?"none":"auto"},onClick:z=>{if(L.current){L.current=!1;return}z.stopPropagation(),u()}})]}),a.jsx(ww,{prefix:e,closeIcon:m,closeIconMaxWidth:h,closeIconColor:x,closeIconHoverColor:w,iconMarginRight:F,contentMarginTop:v,isEditor:o,isPreviewMode:r,isEditMode:l,visible:Fe,onClose:ve})]})}function vd({P:e,media:t,imgWidth:n,cornerRadius:i,fillGalleryWidth:o,imageDisplay:r,isEditor:l,galleryPaddingBetween:c=0,showPaddingAfter:d=!1,showControls:u=!1,hasLightbox:p,onMediaClick:y}){const S=`${e}-gallery-${Ys(t)?"video":"image"}`,m=r.display==="cover",h=yw(r),x=_=>b.scalingValue(_,l??!1),w=n??mo,F=o?{width:"100%",maxWidth:"100%"}:{width:x(w),maxWidth:"100%"},v=i?{borderRadius:x(i)}:{},P={...F,...m?{aspectRatio:h,height:"auto",overflow:"hidden"}:{},...v},M={...m?{display:"block",width:"100%",height:"100%",objectFit:"cover",maxWidth:"100%"}:{display:"block",maxWidth:"100%",height:"auto",width:o?"100%":x(w)},...y?{cursor:"pointer",pointerEvents:"auto"}:{},...m?{}:v},X={className:S,style:M,onClick:y?_=>{_.stopPropagation(),y()}:void 0},j=Math.max(c,ti),N=b.isEmbedMedia(t)?a.jsx(b.EmbedMediaFrame,{...X,media:t,fit:m?"cover":"contain",silentLoop:p}):Ys(t)?a.jsx("video",{...X,src:t.assetId,muted:!0,autoPlay:!0,loop:!0,playsInline:!0}):a.jsx("img",{...X,src:t.assetId,alt:t.name??""});return a.jsxs("div",{className:`${e}-gallery-item`,children:[m?a.jsx("div",{style:P,children:N}):N,d&&c>0&&a.jsx("div",{className:`${e}-padding-handle`,style:{height:x(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:x(j)}})]})}function Cw({P:e,layoutType:t,galleryWidthStyle:n,galleryPaddingRight:i,galleryPaddingLeft:o,galleryPaddingRightWidth:r,galleryPaddingLeftWidth:l,galleryPaddingMaxFraction:c,showControls:d,scaled:u,children:p}){const y=t==="a"?i:t==="c"?o:0,S=y>0||d;return a.jsxs("div",{className:`${e}-gallery-controls`,children:[t==="c"&&S&&a.jsx("div",{className:`${e}-gallery-edge-spacer`,style:{width:u(y)},"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"&&S&&a.jsx("div",{className:`${e}-gallery-edge-spacer`,style:{width:u(y)},"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 Tw(e){switch(e){case"fade":case"retype":case"scroll":return e;case"default":return"scroll";default:return"scroll"}}function Jr({P:e,controlKey:t,scaled:n,height:i,paired:o,side:r}){return a.jsx("div",{"data-controls":t,...o?{"data-controls-paired":""}:{},"data-controls-axis":"y","data-controls-variant":"row-padding","data-controls-min":"0",className:`${e}-control-anchor`,style:{...r==="top"?{top:0}:{bottom:0},left:0,width:"100%",height:n(i)}})}function xd({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 Is({P:e,title:t,description:n,position:i,titleRef:o,titleClassName:r,titleContainerStyle:l,titleTextBoxStyle:c,titleStyle:d,descriptionClassName:u,descriptionStyle:p,descriptionPadding:y,showTextBoxOutline:S=!1,showDescriptionPaddingControl:m=!1,descriptionPaddingPaired:h=!1,topPaddingControl:x,bottomPaddingControl:w}){const F=s.useRef(null),[v,P]=s.useState(0),M=t??"",K=n??"",X=K.length>0,{horizontal:j,vertical:N}=Xl(i),_=N==="center"||N==="bottom",T=N==="bottom";s.useLayoutEffect(()=>{if(!_)return;const I=F.current;if(!I||typeof ResizeObserver>"u")return;const $=()=>P(I.offsetHeight);$();const G=new ResizeObserver($);return G.observe(I),()=>G.disconnect()},[M,K,_]);const L=a.jsx("span",{className:`${e}-title-text`,style:d,children:M}),Y=X?a.jsx("span",{className:u,style:p,children:K}):null,R=X?a.jsx("div",{className:`${e}-title-texts-gap`,style:{height:y},children:m&&a.jsx("div",{"data-controls":"titleDescriptionPadding",...h?{"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:"100%"}})}):null;return a.jsx("div",{ref:I=>{F.current=I,o(I)},className:[r,`${e}-title-h-${j}`,`${e}-title-v-${N}`].join(" "),style:{..._?{[`--${e}-title-height`]:`${v}px`}:{},...l},children:a.jsxs("div",{className:`${e}-title-text-stack`,style:c,children:[x,a.jsx("div",{className:S?`${e}-title-text-inner`:`${e}-title-text-inner-hidden`,style:{width:"100%"},children:a.jsx("div",{className:`${e}-title-texts`,children:T?a.jsxs(a.Fragment,{children:[Y,R,L]}):a.jsxs(a.Fragment,{children:[L,R,Y]})})}),w]})})}const bd=45;function Sd(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 Iw(e){const t=Sd(e,"--cntrl-viewport-height",window.innerHeight),n=Sd(e,"--cntrl-article-top",0);return{top:n,height:t,centerY:n+t/2}}function Lw(e,t,n){const{vertical:i}=Xl(t),{top:o,height:r,centerY:l}=Iw(n);if(i==="top"){const d=n&&parseFloat(getComputedStyle(n).top)||o;return Math.abs(e.top-d)}if(i==="bottom")return Math.abs(e.bottom-(o+r));const c=e.top+e.height/2;return Math.abs(c-l)}function Pw(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=Lw(u,n,d);return Math.exp(-(p*p)/(2*bd*bd))});let o=0,r=-1;return i.forEach((l,c)=>{l>r&&(r=l,o=c)}),{opacities:i,dominantIndex:o}}function Mw(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(Pw(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 wd(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)},70);return()=>window.clearInterval(u)},[t,e]),n}function Ew({settings:e,content:t,isEditor:n,isPreviewMode:i,isEditMode:o,portalId:r}){var kt,Ke;const{prefix:l}=b.useScopedStyles(),c=s.useMemo(()=>tw(l),[l]),d=t??[],u=(e==null?void 0:e.wrapperWidth)??1,p=(e==null?void 0:e.type)??"a",y=(e==null?void 0:e.imgWidth)??mo,S=(e==null?void 0:e.titleWidth)??hw,m=fw(e==null?void 0:e.imageDisplay),h=(e==null?void 0:e.cornerRadius)??JS,x=iw(e==null?void 0:e.position),{horizontal:w,vertical:F}=Xl(x),v=(e==null?void 0:e.titleTopPadding)??0,P=(e==null?void 0:e.titleBottomPadding)??0,M=(e==null?void 0:e.titleLeftPadding)??0,K=(e==null?void 0:e.titleRightPadding)??0,X=(e==null?void 0:e.titleDescriptionPadding)??0,j=Tw(e==null?void 0:e.transition),N=(e==null?void 0:e.lightbox)??"on",_=p==="b",T=j==="fade"||j==="retype",{setTitleRef:L,dominantIndex:Y}=Mw(d.length,T,x),R=((kt=d[Y])==null?void 0:kt.title)??"",I=((Ke=d[Y])==null?void 0:Ke.description)??"",$=wd(R,j==="retype"),G=wd(I,j==="retype"),O=j==="fade"||j==="retype",U=j==="retype"?$:R,E=j==="retype"?G:I,f=_?void 0:{width:b.scalingValue(y,n??!1)},Q=N==="on"&&(!n||i||o),q=o??!1,pe=(e==null?void 0:e.galleryPaddingRight)??0,k=(e==null?void 0:e.galleryPaddingLeft)??0,me=(e==null?void 0:e.galleryPaddingBetween)??0,C=st=>b.scalingValue(st,n??!1),te={width:C(S)},fe=p==="a"?pe:k,Pe=_?{width:"100%"}:{width:`calc(100% - ${C(y)} - ${C(fe)})`,...p==="c"?{marginLeft:"auto"}:{}},de=Math.max(pe,ti),we=Math.max(k,ti),V=Math.max(me,ti),ie=Math.max(v,ti),oe=Math.max(P,ti),le=Math.max(M,ti),ve=Math.max(K,ti),Fe=Math.max(X,ti),Ee=Math.max(0,(u??1)-(y??mo)),Ce=p==="a"?Math.max(0,(u??1)-(y??mo)-pe):p==="c"?Math.max(0,(u??1)-(y??mo)-k):p==="b"?u??1:1,Se=q&&F==="top",g=q&&F==="bottom",Z=q&&w==="left",J=q&&w==="right",re=d.length>1,he=_?void 0:C((p==="c"?k:pe)+(y??mo)),z=p==="c"&&he?{left:he}:void 0,B=p==="a"&&he?{right:he}:void 0,ne=_?{left:0,width:"100%"}:p==="a"?{right:C(pe),width:C(y)}:{left:C(k),width:C(y)},{titleColor:ce,titleFontFamily:ee,titleFontSettings:H,titleFontSize:be,titleLineHeight:ae,titleLetterSpacing:W,titleWordSpacing:ke,titleAlign:ze,titleTextAppearance:Xe,descriptionColor:Ue,descriptionFontFamily:Qe,descriptionFontSettings:We,descriptionFontSize:it,descriptionLineHeight:ye,descriptionLetterSpacing:Te,descriptionWordSpacing:Ve,descriptionAlign:Ze,descriptionTextAppearance:et,lightboxCounterColor:at,lightboxCounterFontFamily:tt,lightboxCounterFontSettings:Ye,lightboxCounterFontSize:xt,lightboxCounterLineHeight:pt,lightboxCounterLetterSpacing:De,lightboxCounterWordSpacing:_e,lightboxCounterTextAppearance:He}=e??{},Ae={fontSettings:{fontFamily:ee,fontWeight:(H==null?void 0:H.fontWeight)??400,fontStyle:(H==null?void 0:H.fontStyle)??"normal"},fontSize:be??.01,lineHeight:ae,letterSpacing:W??0,wordSpacing:ke??0,textAlign:ze??"left",textAppearance:Xe,color:ce??"#000000"},Ie=pn(nn(Ae,n)),mt=te,ot={...Ts(be,ae,l,n),...Ts(it,ye,l,n,"description-leading-gap")},Ct=Cs(be,ae,`${l}-title`,`${l}-text-tight-leading`),rt={fontSettings:{fontFamily:Qe,fontWeight:(We==null?void 0:We.fontWeight)??400,fontStyle:(We==null?void 0:We.fontStyle)??"normal"},fontSize:it??.01,lineHeight:ye,letterSpacing:Te??0,wordSpacing:Ve??0,textAlign:Ze??"left",textAppearance:et,color:Ue??"#000000"},St=pn(nn(rt,n)),nt=Cs(it,ye,`${l}-description-text`,`${l}-description-tight-leading`),Rt=C(q?Fe:X),ht={fontSettings:{fontFamily:tt,fontWeight:(Ye==null?void 0:Ye.fontWeight)??400,fontStyle:(Ye==null?void 0:Ye.fontStyle)??"normal"},fontSize:xt??.01,lineHeight:pt,letterSpacing:De??0,wordSpacing:_e??0,textAppearance:He,color:at??"#DEDDDD"},Zt={...pn(nn(ht,n)),...Ts(xt,pt,l,n)},$e=Cs(xt,pt,`${l}-lightbox-counter`,`${l}-text-tight-leading`),Ge=b.buildColorVars(l,{titleColor:ce??"#000000",descriptionColor:Ue??"#000000",lightboxCounterColor:at??"#DEDDDD"},sw,lw),ft=s.useRef(null),[Lt,wt]=s.useState(!1),[vt,Nt]=s.useState([]),[Wt,Dt]=s.useState(0),Me=s.useCallback((st,It)=>{Q&&(Nt(st),Dt(It),wt(!0))},[Q]),ct=s.useCallback(()=>{wt(!1)},[]),dt=s.useMemo(()=>{const st={...Ge},It=ft.current?getComputedStyle(ft.current).getPropertyValue("--cntrl-article-width").trim():"";return It&&(st["--cntrl-article-width"]=It),st},[Ge,Lt]);return s.useEffect(()=>{if(!Lt||N!=="on"||typeof document>"u")return;const st=document.body.style.overflow;return document.body.style.overflow="hidden",()=>{document.body.style.overflow=st}},[Lt,N]),s.useEffect(()=>{!n||o||i||wt(!1)},[n,o,i]),s.useEffect(()=>{N==="off"&&wt(!1)},[N]),a.jsxs(a.Fragment,{children:[a.jsx("style",{dangerouslySetInnerHTML:{__html:c}}),a.jsx("div",{style:Ge,children:a.jsxs("div",{ref:ft,className:`${l}-wrapper`,style:{width:b.scalingValue(u,n??!1),[`--${l}-title-top-padding`]:F==="top"?C(v):void 0,[`--${l}-title-bottom-padding`]:F==="bottom"?C(P):void 0,[`--${l}-title-left-padding`]:w==="left"?C(M):void 0,[`--${l}-title-right-padding`]:w==="right"?C(K):void 0},children:[O&&a.jsx("div",{className:`${l}-single-title-layer`,children:a.jsx(Is,{P:l,title:U,description:E,position:x,titleRef:()=>{},titleClassName:`${Ct} ${l}-single-title`,titleContainerStyle:{...ot,...Pe},titleTextBoxStyle:mt,titleStyle:Ie,descriptionClassName:nt,descriptionStyle:St,descriptionPadding:Rt,showTextBoxOutline:q,showDescriptionPaddingControl:q,topPaddingControl:Se?Jr({P:l,controlKey:"titleTopPadding",scaled:C,height:ie,paired:!1,side:"top"}):void 0,bottomPaddingControl:g?Jr({P:l,controlKey:"titleBottomPadding",scaled:C,height:oe,paired:!1,side:"bottom"}):void 0})}),d.map((st,It)=>{const At=pw(st.gallery),ut=It<d.length-1,Xt=At.filter(Ot=>Ot.lightboxMedia).map(Ot=>Ot.lightboxMedia),Ut={P:l,position:x,titleRef:L(It),titleClassName:Ct,titleContainerStyle:ot,titleTextBoxStyle:O?{maxWidth:"100%"}:mt,titleStyle:Ie,descriptionClassName:nt,descriptionStyle:St,descriptionPadding:Rt,showTextBoxOutline:q&&!O,showDescriptionPaddingControl:q&&!O,descriptionPaddingPaired:re,topPaddingControl:Se&&!O?Jr({P:l,controlKey:"titleTopPadding",scaled:C,height:ie,paired:re,side:"top"}):void 0,bottomPaddingControl:g&&!O?Jr({P:l,controlKey:"titleBottomPadding",scaled:C,height:oe,paired:re,side:"bottom"}):void 0};return a.jsxs("div",{"data-item-index":It,className:`${l}-item ${l}-item-${p}`,style:{paddingBottom:ut?C(me):void 0},children:[Z&&xd({P:l,controlKey:"titleLeftPadding",scaled:C,width:le,maxFraction:Ce,side:"left",paired:re,anchorStyle:z}),J&&xd({P:l,controlKey:"titleRightPadding",scaled:C,width:ve,maxFraction:Ce,side:"right",paired:re,anchorStyle:B}),q&&ut&&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(V),...ne}}),_?a.jsxs("div",{className:`${l}-gallery`,children:[a.jsx("div",{className:`${l}-gallery-media`,children:At.map(({displayMedia:Ot,lightboxMedia:Bt},jt)=>{const zt=Bt?Xt.findIndex(Kt=>Kt.assetId===Bt.assetId):-1;return a.jsx(vd,{P:l,media:Ot,imgWidth:y||void 0,cornerRadius:h||void 0,imageDisplay:m,isEditor:n,galleryPaddingBetween:me,showPaddingAfter:jt<At.length-1,showControls:q,hasLightbox:N==="on",onMediaClick:Q&&zt>=0?()=>Me(Xt,zt):void 0},`${Ot.assetId}-${jt}`)})}),a.jsx("div",{className:`${l}-title-layer`,children:a.jsx(Is,{...Ut,title:O?"":st.title,description:O?"":st.description})})]}):a.jsxs(a.Fragment,{children:[a.jsx(Is,{...Ut,title:O?"":st.title,description:O?"":st.description}),At.length>0&&a.jsx(Cw,{P:l,layoutType:p,galleryWidthStyle:f,galleryPaddingRight:pe,galleryPaddingLeft:k,galleryPaddingRightWidth:de,galleryPaddingLeftWidth:we,galleryPaddingMaxFraction:Ee,showControls:q,scaled:C,children:At.map(({displayMedia:Ot,lightboxMedia:Bt},jt)=>{const zt=Bt?Xt.findIndex(Kt=>Kt.assetId===Bt.assetId):-1;return a.jsx(vd,{P:l,media:Ot,cornerRadius:h||void 0,fillGalleryWidth:!0,imageDisplay:m,isEditor:n,galleryPaddingBetween:me,showPaddingAfter:jt<At.length-1,showControls:q,hasLightbox:N==="on",onMediaClick:Q&&zt>=0?()=>Me(Xt,zt):void 0},`${Ot.assetId}-${jt}`)})})]})]},It)})]})}),Lt&&N==="on"&&typeof document<"u"&&e&&(()=>{const st=(r?document.getElementById(r):null)??document.body;return qn.createPortal(a.jsx("div",{style:dt,"data-selection":"none",children:a.jsx($w,{prefix:l,items:vt,index:Wt,imageDisplay:vw(e.lightboxImageDisplay),isEditor:n,isPreviewMode:i,isEditMode:o,closeIcon:e.closeIcon,closeIconMaxWidth:e.closeIconMaxWidth,closeIconColor:e.closeIconColor,closeIconHoverColor:e.closeIconHoverColor,iconMarginRight:e.iconMarginRight,contentMarginTop:e.contentMarginTop,onClose:ct,onPrev:()=>Dt(It=>(It-1+vt.length)%vt.length),onNext:()=>Dt(It=>(It+1)%vt.length),counterClassName:$e,counterStyle:Zt,backgroundColor:e.backgroundColor??ow})}),st)})()]})}const Rw=`import { useCallback, useEffect, useLayoutEffect, useMemo, useRef, useState } from 'react';
|
|
21501
|
+
`}const Mp={"left-top":{horizontal:"left",vertical:"top"},"top-center":{horizontal:"center",vertical:"top"},"top-right":{horizontal:"right",vertical:"top"},"left-center":{horizontal:"left",vertical:"center"},center:{horizontal:"center",vertical:"center"},"right-center":{horizontal:"right",vertical:"center"},"left-bottom":{horizontal:"left",vertical:"bottom"},"bottom-center":{horizontal:"center",vertical:"bottom"},"right-bottom":{horizontal:"right",vertical:"bottom"}};function nw(e){return e in Mp}function iw(e){if(e&&nw(e))return e;switch(e){case"center-top":return"top-center";case"right-top":return"top-right";case"top-left":return"left-top";case"center-bottom":return"bottom-center";case"bottom-left":return"left-bottom";case"bottom-right":return"right-bottom";case"center-center":return"center";case"left":return"left-center";case"right":return"right-center";case"top":return"left-top";default:return"center"}}function Xl(e){return Mp[e]}const ow="rgba(28,31,34,0.9)",Jn=500,Bi="cubic-bezier(0.22, 1, 0.36, 1)",rw=72,aw=50,sw={titleColor:"title-color",descriptionColor:"description-color",lightboxCounterColor:"lightbox-counter-color"},lw=[];function cw(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 dw(e){const[t,n]=e.media;return n!=null&&n.assetId?n:t!=null&&t.assetId?t:null}function uw(e){const[t]=e.media;return t!=null&&t.assetId?t:null}function pw(e){if(!Array.isArray(e)||e.length===0)return[];if(cw(e)){const t=[];for(const n of e){const i=dw(n);if(!i)continue;const o=uw(n);t.push({displayMedia:i,lightboxMedia:o!=null&&o.assetId?o:null})}return t}return e.filter(t=>t==null?void 0:t.assetId).map(t=>({displayMedia:t,lightboxMedia:t}))}function Ys(e){return e.type==="video"}function mw(e){e.pause(),e.removeAttribute("src"),e.load()}function Zr(e){const t=e.getBoundingClientRect();return{width:t.width,height:t.height,left:t.left,top:t.top}}function gw(e){return e instanceof HTMLVideoElement?{width:e.videoWidth,height:e.videoHeight}:{width:e.naturalWidth,height:e.naturalHeight}}const hw=1140/1440;function fw(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 yw(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 vw(e){return typeof e=="string"?e==="cover"?"cover":"fit":(e==null?void 0:e.display)==="cover"?"cover":"fit"}function xw({src:e,mediaRef:t,mediaStyle:n,onLoadedMetadata:i,onTransitionEnd:o}){return s.useEffect(()=>{const r=t.current;if(r)return()=>{mw(r)}},[e,t]),a.jsx("video",{ref:t,src:e,muted:!0,autoPlay:!0,loop:!0,playsInline:!0,preload:"auto",onLoadedMetadata:i,onTransitionEnd:o,style:n})}const bw="https://cdn.cntrl.site/component-assets/defaultCloseIcon.svg",Sw=.004;function ww({prefix:e,closeIcon:t=bw,closeIconMaxWidth:n=.0125,closeIconColor:i="#FFFFFF",closeIconHoverColor:o="#999999",iconMarginRight:r=.01,contentMarginTop:l=.01,isEditor:c,isPreviewMode:d,isEditMode:u,visible:p,onClose:y}){if(!t)return null;const S=b.scalingValue(n,c),m=b.scalingValue(r,c),h=b.scalingValue(l,c),x=b.scalingValue(Math.max(l,Sw),c);return a.jsxs("div",{style:{position:"absolute",top:0,left:0,right:0,zIndex:1e4,display:"flex",flexDirection:"column",alignItems:"flex-end",pointerEvents:"none",opacity:p?1:0,transition:"opacity 500ms cubic-bezier(0.22, 1, 0.36, 1)"},children:[a.jsx("div",{style:{position:"relative",width:"100%",height:h,flexShrink:0},children:u&&a.jsx("div",{"data-controls":"contentMarginTop","data-controls-axis":"y","data-controls-min":"0",className:`${e}-control`,style:{position:"absolute",top:0,left:0,width:"100%",height:x,pointerEvents:p?"auto":"none"}})}),a.jsxs("div",{className:`${e}-close-icon`,style:{width:S,height:S,marginRight:m,pointerEvents:p?"auto":"none"},onClick:w=>w.stopPropagation(),children:[a.jsx("button",{type:"button",className:`${e}-close-icon-inner`,"aria-label":"Close",onClick:w=>{w.stopPropagation(),y()},children:a.jsx(mn,{url:t,fill:i,hoverFill:c&&!d?i:o,className:`${e}-close-icon-img`})}),u&&a.jsx("div",{"data-controls":"iconMarginRight","data-controls-axis":"x","data-controls-reverse":"",className:`${e}-control`,style:{position:"absolute",top:0,left:"100%",width:m,height:"100%",pointerEvents:p?"auto":"none"}})]})]})}function $w({prefix:e,items:t,index:n,imageDisplay:i,isEditor:o,isPreviewMode:r,isEditMode:l,onClose:c,onPrev:d,onNext:u,counterClassName:p,counterStyle:y,backgroundColor:S,closeIcon:m,closeIconMaxWidth:h,closeIconColor:x,closeIconHoverColor:w,iconMarginRight:F,contentMarginTop:v}){const P=i==="cover",M=s.useRef(null),K=s.useRef(null),X=s.useRef(null),j=s.useRef(0),N=s.useRef(0),_=s.useRef("none"),T=s.useRef(!1),L=s.useRef(!1),Y=s.useRef(!1),R=s.useRef(null),[I,$]=s.useState(null),[G,O]=s.useState("opening"),[U,E]=s.useState(0),[f,Q]=s.useState(0),[q,pe]=s.useState(!1),[k,me]=s.useState(!1),[C,ue]=s.useState(!1),te=s.useRef(n),fe=t[n],Pe=fe?Ys(fe):!1,de=fe?b.isEmbedMedia(fe):!1,we=f!==0||q,V=s.useCallback(z=>{Y.current=z,pe(z)},[]),ie=s.useCallback(()=>{R.current!==null&&(window.clearTimeout(R.current),R.current=null)},[]),oe=s.useCallback(()=>{ie(),R.current=window.setTimeout(()=>{ie(),V(!1)},Jn+32)},[ie,V]),le=s.useCallback(()=>{const z=M.current,B=K.current;if(!z)return;const ne=z.getBoundingClientRect(),ce=ne.width,ee=ne.height;if(!ce||!ee)return;if(i==="cover"){$({width:ce,height:ee,left:ne.left,top:ne.top});return}let H=fe&&b.isEmbedMedia(fe)?b.getEmbedAspect(fe):null;if(H===null){if(!B){$(Zr(z));return}const{width:ae,height:W}=gw(B);if(!ae||!W){$(Zr(z));return}H=ae/W}const be=ce/ee;if(H>be){const ae=ce/H;$({width:ce,height:ae,left:ne.left,top:ne.top+(ee-ae)/2})}else{const ae=ee*H;$({width:ae,height:ee,left:ne.left+(ce-ae)/2,top:ne.top})}},[i,fe]);s.useEffect(()=>{le();const z=M.current;if(!z)return;const B=new ResizeObserver(()=>le());return B.observe(z),()=>B.disconnect()},[le,n]),s.useEffect(()=>{G==="opening"&&I&&O("open")},[G,I]),s.useEffect(()=>{if(G!=="closing")return;const z=setTimeout(()=>c(),Jn);return()=>clearTimeout(z)},[G,c]),s.useEffect(()=>()=>{ie()},[ie]),s.useLayoutEffect(()=>{if(te.current===n)return;ie(),E(0),Q(0),V(!1),ue(!1),me(!1),j.current=0,N.current=0,_.current="none",T.current=!1,X.current=null,L.current=!1;const z=M.current;z&&$(Zr(z)),te.current=n},[n,V,ie]),s.useEffect(()=>{if(G!=="open")return;let z=null;const B=()=>{z&&(document.removeEventListener("click",z,!0),z=null)},ne=()=>{B(),z=W=>{W.stopPropagation(),W.preventDefault(),B()},document.addEventListener("click",z,!0)},ce=W=>{ie(),Y.current=!1,pe(!1),Q(0),me(!1),T.current=!1,N.current=0,_.current="none";const ke=M.current;ke&&$(Zr(ke)),W<0?u():d()},ee=W=>{if(Math.abs(W)>aw&&t.length>1){ce(W);return}V(!0),Q(0),oe()},H=W=>{if(W.touches.length!==1||Y.current)return;const ke=W.touches[0];L.current=!0,X.current={x:ke.clientX,y:ke.clientY},_.current="none",N.current=0,T.current=!1},be=W=>{if(!X.current||W.touches.length!==1||Y.current)return;const ke=W.touches[0],ze=ke.clientX-X.current.x,Xe=ke.clientY-X.current.y;if(_.current==="none"){if(Math.abs(ze)<10&&Math.abs(Xe)<10)return;if(Math.abs(ze)>Math.abs(Xe)){if(t.length<=1)return;_.current="horizontal"}else if(Xe>0)_.current="vertical";else return}if(_.current==="horizontal"){T.current=!0,me(!0),N.current=ze,Q(ze),W.preventDefault();return}_.current==="vertical"&&(T.current=!0,me(!0),j.current=Xe,E(Xe),W.preventDefault())},ae=()=>{if(!X.current)return;const W=_.current,ke=T.current;if(ke&&W==="horizontal")ee(N.current),ne();else if(ke&&W==="vertical")if(j.current>rw){const Xe=window.innerHeight;j.current=Xe,ue(!0),E(Xe),O("closing")}else j.current=0,E(0),ne();else W==="horizontal"&&Math.abs(N.current)>0&&(ee(N.current),ne());X.current=null,_.current="none",N.current=0,T.current=!1,me(!1)};return document.addEventListener("touchstart",H,{passive:!0}),document.addEventListener("touchmove",be,{passive:!1}),document.addEventListener("touchend",ae),document.addEventListener("touchcancel",ae),()=>{document.removeEventListener("touchstart",H),document.removeEventListener("touchmove",be),document.removeEventListener("touchend",ae),document.removeEventListener("touchcancel",ae),B()}},[G,t.length,u,d,V,oe,ie]),s.useEffect(()=>{const z=B=>{B.key==="Escape"&&(B.preventDefault(),B.stopPropagation(),G!=="closing"&&O("closing"))};return window.addEventListener("keydown",z,!0),()=>window.removeEventListener("keydown",z,!0)},[G]);const ve=()=>{G!=="closing"&&O("closing")},Fe=G==="open",Ee=G==="closing",Ce=U>0?Math.max(0,1-U/500):1,Se=U>0?Math.max(.35,1-U/500):1,g=s.useCallback(z=>{z.propertyName!=="transform"||!Y.current||(ie(),V(!1))},[ie,V]),Z=we?`translateX(${f}px)`:U>0?`translateY(${U}px)`:void 0,J={position:"fixed",top:I==null?void 0:I.top,left:I==null?void 0:I.left,width:I==null?void 0:I.width,height:I==null?void 0:I.height,objectFit:i==="cover"?"cover":"contain",transform:Z,opacity:U>0?Se:G==="opening"||Ee?0:1,transition:k&&!q?"none":q?`transform ${Jn}ms ${Bi}`:C?`transform ${Jn}ms ${Bi}, opacity ${Jn}ms ${Bi}`:G==="opening"||Ee?`opacity ${Jn}ms ${Bi}`:"none",pointerEvents:"none",zIndex:9998},re=de&&fe&&b.getEmbedPlayback(fe).controls&&I?Math.min(52,I.height*.2):0,he=I?{position:"fixed",top:I.top,height:I.height-re,width:I.width/2,zIndex:9999}:null;return a.jsxs("div",{className:[`${e}-lightbox`,o?`${e}-lightbox-editor`:""].filter(Boolean).join(" "),style:{touchAction:G==="open"?"none":void 0},onClick:ve,children:[a.jsx("div",{style:{position:"absolute",inset:0,background:S,opacity:Fe?Ce:0,transition:k?"none":`opacity ${Jn}ms ${Bi}`,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:M,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:Fe?1:0,transition:`opacity ${Jn}ms ${Bi}`,pointerEvents:"none",zIndex:9999},children:t.length>1&&a.jsxs("p",{className:p,style:y,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:M,style:{width:"100%",height:"100%"}})}),a.jsx("div",{style:{display:"flex",flexDirection:"row",justifyContent:"center",alignItems:"center",height:"10%",opacity:Fe?1:0,transition:`opacity ${Jn}ms ${Bi}`},children:t.length>1&&a.jsxs("p",{className:p,style:y,children:[n+1," / ",t.length]})})]})}),I&&fe&&(de?a.jsx(b.EmbedMediaFrame,{media:fe,fit:i==="cover"?"cover":"contain",lazy:!1,startsAtOnce:!0,style:J,onTransitionEnd:g},`${n}-${fe.assetId}`):Pe?a.jsx(xw,{src:fe.assetId,mediaRef:K,mediaStyle:J,onLoadedMetadata:le,onTransitionEnd:g},`${n}-${fe.assetId}`):a.jsx("img",{ref:K,src:fe.assetId,alt:fe.name,onLoad:le,onTransitionEnd:g,style:J},`${n}-${fe.assetId}`)),Fe&&he&&t.length>1&&a.jsxs(a.Fragment,{children:[a.jsx("div",{style:{...he,left:I.left,cursor:"w-resize",pointerEvents:we?"none":"auto"},onClick:z=>{if(L.current){L.current=!1;return}z.stopPropagation(),d()}}),a.jsx("div",{style:{...he,left:I.left+I.width/2,cursor:"e-resize",pointerEvents:we?"none":"auto"},onClick:z=>{if(L.current){L.current=!1;return}z.stopPropagation(),u()}})]}),a.jsx(ww,{prefix:e,closeIcon:m,closeIconMaxWidth:h,closeIconColor:x,closeIconHoverColor:w,iconMarginRight:F,contentMarginTop:v,isEditor:o,isPreviewMode:r,isEditMode:l,visible:Fe,onClose:ve})]})}function vd({P:e,media:t,imgWidth:n,cornerRadius:i,fillGalleryWidth:o,imageDisplay:r,isEditor:l,galleryPaddingBetween:c=0,showPaddingAfter:d=!1,showControls:u=!1,hasLightbox:p,onMediaClick:y}){const S=`${e}-gallery-${Ys(t)?"video":"image"}`,m=r.display==="cover",h=yw(r),x=_=>b.scalingValue(_,l??!1),w=n??mo,F=o?{width:"100%",maxWidth:"100%"}:{width:x(w),maxWidth:"100%"},v=i?{borderRadius:x(i)}:{},P={...F,...m?{aspectRatio:h,height:"auto",overflow:"hidden"}:{},...v},M={...m?{display:"block",width:"100%",height:"100%",objectFit:"cover",maxWidth:"100%"}:{display:"block",maxWidth:"100%",height:"auto",width:o?"100%":x(w)},...y?{cursor:"pointer",pointerEvents:"auto"}:{},...m?{}:v},X={className:S,style:M,onClick:y?_=>{_.stopPropagation(),y()}:void 0},j=Math.max(c,ti),N=b.isEmbedMedia(t)?a.jsx(b.EmbedMediaFrame,{...X,media:t,fit:m?"cover":"contain",silentLoop:p}):Ys(t)?a.jsx("video",{...X,src:t.assetId,muted:!0,autoPlay:!0,loop:!0,playsInline:!0}):a.jsx("img",{...X,src:t.assetId,alt:t.name??""});return a.jsxs("div",{className:`${e}-gallery-item`,children:[m?a.jsx("div",{style:P,children:N}):N,d&&c>0&&a.jsx("div",{className:`${e}-padding-handle`,style:{height:x(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:x(j)}})]})}function Cw({P:e,layoutType:t,galleryWidthStyle:n,galleryPaddingRight:i,galleryPaddingLeft:o,galleryPaddingRightWidth:r,galleryPaddingLeftWidth:l,galleryPaddingMaxFraction:c,showControls:d,scaled:u,children:p}){const y=t==="a"?i:t==="c"?o:0,S=y>0||d;return a.jsxs("div",{className:`${e}-gallery-controls`,children:[t==="c"&&S&&a.jsx("div",{className:`${e}-gallery-edge-spacer`,style:{width:u(y)},"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"&&S&&a.jsx("div",{className:`${e}-gallery-edge-spacer`,style:{width:u(y)},"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 Tw(e){switch(e){case"fade":case"retype":case"scroll":return e;case"default":return"scroll";default:return"scroll"}}function Jr({P:e,controlKey:t,scaled:n,height:i,paired:o,side:r}){return a.jsx("div",{"data-controls":t,...o?{"data-controls-paired":""}:{},"data-controls-axis":"y","data-controls-variant":"row-padding","data-controls-min":"0",className:`${e}-control-anchor`,style:{...r==="top"?{top:0}:{bottom:0},left:0,width:"100%",height:n(i)}})}function xd({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 Is({P:e,title:t,description:n,position:i,titleRef:o,titleClassName:r,titleContainerStyle:l,titleTextBoxStyle:c,titleStyle:d,descriptionClassName:u,descriptionStyle:p,descriptionPadding:y,showTextBoxOutline:S=!1,showDescriptionPaddingControl:m=!1,descriptionPaddingPaired:h=!1,topPaddingControl:x,bottomPaddingControl:w}){const F=s.useRef(null),[v,P]=s.useState(0),M=t??"",K=n??"",X=K.length>0,{horizontal:j,vertical:N}=Xl(i),_=N==="center"||N==="bottom",T=N==="bottom";s.useLayoutEffect(()=>{if(!_)return;const I=F.current;if(!I||typeof ResizeObserver>"u")return;const $=()=>P(I.offsetHeight);$();const G=new ResizeObserver($);return G.observe(I),()=>G.disconnect()},[M,K,_]);const L=a.jsx("span",{className:`${e}-title-text`,style:d,children:M}),Y=X?a.jsx("span",{className:u,style:p,children:K}):null,R=X?a.jsx("div",{className:`${e}-title-texts-gap`,style:{height:y},children:m&&a.jsx("div",{"data-controls":"titleDescriptionPadding",...h?{"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:"100%"}})}):null;return a.jsx("div",{ref:I=>{F.current=I,o(I)},className:[r,`${e}-title-h-${j}`,`${e}-title-v-${N}`].join(" "),style:{..._?{[`--${e}-title-height`]:`${v}px`}:{},...l},children:a.jsxs("div",{className:`${e}-title-text-stack`,style:c,children:[x,a.jsx("div",{className:S?`${e}-title-text-inner`:`${e}-title-text-inner-hidden`,style:{width:"100%"},children:a.jsx("div",{className:`${e}-title-texts`,children:T?a.jsxs(a.Fragment,{children:[Y,R,L]}):a.jsxs(a.Fragment,{children:[L,R,Y]})})}),w]})})}const bd=45;function Sd(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 Iw(e){const t=Sd(e,"--cntrl-viewport-height",window.innerHeight),n=Sd(e,"--cntrl-article-top",0);return{top:n,height:t,centerY:n+t/2}}function Lw(e,t,n){const{vertical:i}=Xl(t),{top:o,height:r,centerY:l}=Iw(n);if(i==="top"){const d=n&&parseFloat(getComputedStyle(n).top)||o;return Math.abs(e.top-d)}if(i==="bottom")return Math.abs(e.bottom-(o+r));const c=e.top+e.height/2;return Math.abs(c-l)}function Pw(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=Lw(u,n,d);return Math.exp(-(p*p)/(2*bd*bd))});let o=0,r=-1;return i.forEach((l,c)=>{l>r&&(r=l,o=c)}),{opacities:i,dominantIndex:o}}function Mw(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(Pw(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 wd(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)},70);return()=>window.clearInterval(u)},[t,e]),n}function Ew({settings:e,content:t,isEditor:n,isPreviewMode:i,isEditMode:o,portalId:r}){var kt,Ke;const{prefix:l}=b.useScopedStyles(),c=s.useMemo(()=>tw(l),[l]),d=t??[],u=(e==null?void 0:e.wrapperWidth)??1,p=(e==null?void 0:e.type)??"a",y=(e==null?void 0:e.imgWidth)??mo,S=(e==null?void 0:e.titleWidth)??hw,m=fw(e==null?void 0:e.imageDisplay),h=(e==null?void 0:e.cornerRadius)??JS,x=iw(e==null?void 0:e.position),{horizontal:w,vertical:F}=Xl(x),v=(e==null?void 0:e.titleTopPadding)??0,P=(e==null?void 0:e.titleBottomPadding)??0,M=(e==null?void 0:e.titleLeftPadding)??0,K=(e==null?void 0:e.titleRightPadding)??0,X=(e==null?void 0:e.titleDescriptionPadding)??0,j=Tw(e==null?void 0:e.transition),N=(e==null?void 0:e.lightbox)??"on",_=p==="b",T=j==="fade"||j==="retype",{setTitleRef:L,dominantIndex:Y}=Mw(d.length,T,x),R=((kt=d[Y])==null?void 0:kt.title)??"",I=((Ke=d[Y])==null?void 0:Ke.description)??"",$=wd(R,j==="retype"),G=wd(I,j==="retype"),O=j==="fade"||j==="retype",U=j==="retype"?$:R,E=j==="retype"?G:I,f=_?void 0:{width:b.scalingValue(y,n??!1)},Q=N==="on"&&(!n||i||o),q=o??!1,pe=(e==null?void 0:e.galleryPaddingRight)??0,k=(e==null?void 0:e.galleryPaddingLeft)??0,me=(e==null?void 0:e.galleryPaddingBetween)??0,C=st=>b.scalingValue(st,n??!1),te={width:C(S)},fe=p==="a"?pe:k,Pe=_?{width:"100%"}:{width:`calc(100% - ${C(y)} - ${C(fe)})`,...p==="c"?{marginLeft:"auto"}:{}},de=Math.max(pe,ti),we=Math.max(k,ti),V=Math.max(me,ti),ie=Math.max(v,ti),oe=Math.max(P,ti),le=Math.max(M,ti),ve=Math.max(K,ti),Fe=Math.max(X,ti),Ee=Math.max(0,(u??1)-(y??mo)),Ce=p==="a"?Math.max(0,(u??1)-(y??mo)-pe):p==="c"?Math.max(0,(u??1)-(y??mo)-k):p==="b"?u??1:1,Se=q&&F==="top",g=q&&F==="bottom",Z=q&&w==="left",J=q&&w==="right",re=d.length>1,he=_?void 0:C((p==="c"?k:pe)+(y??mo)),z=p==="c"&&he?{left:he}:void 0,B=p==="a"&&he?{right:he}:void 0,ne=_?{left:0,width:"100%"}:p==="a"?{right:C(pe),width:C(y)}:{left:C(k),width:C(y)},{titleColor:ce,titleFontFamily:ee,titleFontSettings:H,titleFontSize:be,titleLineHeight:ae,titleLetterSpacing:W,titleWordSpacing:ke,titleAlign:ze,titleTextAppearance:Xe,descriptionColor:Ue,descriptionFontFamily:Qe,descriptionFontSettings:We,descriptionFontSize:it,descriptionLineHeight:ye,descriptionLetterSpacing:Te,descriptionWordSpacing:Ve,descriptionAlign:Ze,descriptionTextAppearance:et,lightboxCounterColor:at,lightboxCounterFontFamily:tt,lightboxCounterFontSettings:Ye,lightboxCounterFontSize:xt,lightboxCounterLineHeight:pt,lightboxCounterLetterSpacing:De,lightboxCounterWordSpacing:_e,lightboxCounterTextAppearance:He}=e??{},Ae={fontSettings:{fontFamily:ee,fontWeight:(H==null?void 0:H.fontWeight)??400,fontStyle:(H==null?void 0:H.fontStyle)??"normal"},fontSize:be??.01,lineHeight:ae,letterSpacing:W??0,wordSpacing:ke??0,textAlign:ze??"left",textAppearance:Xe,color:ce??"#000000"},Ie=pn(nn(Ae,n)),mt=te,ot={...Ts(be,ae,l,n),...Ts(it,ye,l,n,"description-leading-gap")},Ct=Cs(be,ae,`${l}-title`,`${l}-text-tight-leading`),rt={fontSettings:{fontFamily:Qe,fontWeight:(We==null?void 0:We.fontWeight)??400,fontStyle:(We==null?void 0:We.fontStyle)??"normal"},fontSize:it??.01,lineHeight:ye,letterSpacing:Te??0,wordSpacing:Ve??0,textAlign:Ze??"left",textAppearance:et,color:Ue??"#000000"},St=pn(nn(rt,n)),nt=Cs(it,ye,`${l}-description-text`,`${l}-description-tight-leading`),Rt=C(q?Fe:X),ht={fontSettings:{fontFamily:tt,fontWeight:(Ye==null?void 0:Ye.fontWeight)??400,fontStyle:(Ye==null?void 0:Ye.fontStyle)??"normal"},fontSize:xt??.01,lineHeight:pt,letterSpacing:De??0,wordSpacing:_e??0,textAppearance:He,color:at??"#DEDDDD"},Zt={...pn(nn(ht,n)),...Ts(xt,pt,l,n)},$e=Cs(xt,pt,`${l}-lightbox-counter`,`${l}-text-tight-leading`),Ge=b.buildColorVars(l,{titleColor:ce??"#000000",descriptionColor:Ue??"#000000",lightboxCounterColor:at??"#DEDDDD"},sw,lw),ft=s.useRef(null),[Lt,wt]=s.useState(!1),[vt,Nt]=s.useState([]),[Wt,Dt]=s.useState(0),Me=s.useCallback((st,It)=>{Q&&(Nt(st),Dt(It),wt(!0))},[Q]),ct=s.useCallback(()=>{wt(!1)},[]),dt=s.useMemo(()=>{const st={...Ge},It=ft.current?getComputedStyle(ft.current).getPropertyValue("--cntrl-article-width").trim():"";return It&&(st["--cntrl-article-width"]=It),st},[Ge,Lt]);return s.useEffect(()=>{if(!Lt||N!=="on"||typeof document>"u")return;const st=document.body.style.overflow;return document.body.style.overflow="hidden",()=>{document.body.style.overflow=st}},[Lt,N]),s.useEffect(()=>{!n||o||i||wt(!1)},[n,o,i]),s.useEffect(()=>{N==="off"&&wt(!1)},[N]),a.jsxs(a.Fragment,{children:[a.jsx("style",{dangerouslySetInnerHTML:{__html:c}}),a.jsx("div",{style:Ge,children:a.jsxs("div",{ref:ft,className:`${l}-wrapper`,style:{width:b.scalingValue(u,n??!1),[`--${l}-title-top-padding`]:F==="top"?C(v):void 0,[`--${l}-title-bottom-padding`]:F==="bottom"?C(P):void 0,[`--${l}-title-left-padding`]:w==="left"?C(M):void 0,[`--${l}-title-right-padding`]:w==="right"?C(K):void 0},children:[O&&a.jsx("div",{className:`${l}-single-title-layer`,children:a.jsx(Is,{P:l,title:U,description:E,position:x,titleRef:()=>{},titleClassName:`${Ct} ${l}-single-title`,titleContainerStyle:{...ot,...Pe},titleTextBoxStyle:mt,titleStyle:Ie,descriptionClassName:nt,descriptionStyle:St,descriptionPadding:Rt,showTextBoxOutline:q,showDescriptionPaddingControl:q,topPaddingControl:Se?Jr({P:l,controlKey:"titleTopPadding",scaled:C,height:ie,paired:!1,side:"top"}):void 0,bottomPaddingControl:g?Jr({P:l,controlKey:"titleBottomPadding",scaled:C,height:oe,paired:!1,side:"bottom"}):void 0})}),d.map((st,It)=>{const At=pw(st.gallery),ut=It<d.length-1,Gt=At.filter(Ot=>Ot.lightboxMedia).map(Ot=>Ot.lightboxMedia),Ut={P:l,position:x,titleRef:L(It),titleClassName:Ct,titleContainerStyle:ot,titleTextBoxStyle:O?{maxWidth:"100%"}:mt,titleStyle:Ie,descriptionClassName:nt,descriptionStyle:St,descriptionPadding:Rt,showTextBoxOutline:q&&!O,showDescriptionPaddingControl:q&&!O,descriptionPaddingPaired:re,topPaddingControl:Se&&!O?Jr({P:l,controlKey:"titleTopPadding",scaled:C,height:ie,paired:re,side:"top"}):void 0,bottomPaddingControl:g&&!O?Jr({P:l,controlKey:"titleBottomPadding",scaled:C,height:oe,paired:re,side:"bottom"}):void 0};return a.jsxs("div",{"data-item-index":It,className:`${l}-item ${l}-item-${p}`,style:{paddingBottom:ut?C(me):void 0},children:[Z&&xd({P:l,controlKey:"titleLeftPadding",scaled:C,width:le,maxFraction:Ce,side:"left",paired:re,anchorStyle:z}),J&&xd({P:l,controlKey:"titleRightPadding",scaled:C,width:ve,maxFraction:Ce,side:"right",paired:re,anchorStyle:B}),q&&ut&&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(V),...ne}}),_?a.jsxs("div",{className:`${l}-gallery`,children:[a.jsx("div",{className:`${l}-gallery-media`,children:At.map(({displayMedia:Ot,lightboxMedia:Bt},Xt)=>{const zt=Bt?Gt.findIndex(Kt=>Kt.assetId===Bt.assetId):-1;return a.jsx(vd,{P:l,media:Ot,imgWidth:y||void 0,cornerRadius:h||void 0,imageDisplay:m,isEditor:n,galleryPaddingBetween:me,showPaddingAfter:Xt<At.length-1,showControls:q,hasLightbox:N==="on",onMediaClick:Q&&zt>=0?()=>Me(Gt,zt):void 0},`${Ot.assetId}-${Xt}`)})}),a.jsx("div",{className:`${l}-title-layer`,children:a.jsx(Is,{...Ut,title:O?"":st.title,description:O?"":st.description})})]}):a.jsxs(a.Fragment,{children:[a.jsx(Is,{...Ut,title:O?"":st.title,description:O?"":st.description}),At.length>0&&a.jsx(Cw,{P:l,layoutType:p,galleryWidthStyle:f,galleryPaddingRight:pe,galleryPaddingLeft:k,galleryPaddingRightWidth:de,galleryPaddingLeftWidth:we,galleryPaddingMaxFraction:Ee,showControls:q,scaled:C,children:At.map(({displayMedia:Ot,lightboxMedia:Bt},Xt)=>{const zt=Bt?Gt.findIndex(Kt=>Kt.assetId===Bt.assetId):-1;return a.jsx(vd,{P:l,media:Ot,cornerRadius:h||void 0,fillGalleryWidth:!0,imageDisplay:m,isEditor:n,galleryPaddingBetween:me,showPaddingAfter:Xt<At.length-1,showControls:q,hasLightbox:N==="on",onMediaClick:Q&&zt>=0?()=>Me(Gt,zt):void 0},`${Ot.assetId}-${Xt}`)})})]})]},It)})]})}),Lt&&N==="on"&&typeof document<"u"&&e&&(()=>{const st=(r?document.getElementById(r):null)??document.body;return qn.createPortal(a.jsx("div",{style:dt,"data-selection":"none",children:a.jsx($w,{prefix:l,items:vt,index:Wt,imageDisplay:vw(e.lightboxImageDisplay),isEditor:n,isPreviewMode:i,isEditMode:o,closeIcon:e.closeIcon,closeIconMaxWidth:e.closeIconMaxWidth,closeIconColor:e.closeIconColor,closeIconHoverColor:e.closeIconHoverColor,iconMarginRight:e.iconMarginRight,contentMarginTop:e.contentMarginTop,onClose:ct,onPrev:()=>Dt(It=>(It-1+vt.length)%vt.length),onNext:()=>Dt(It=>(It+1)%vt.length),counterClassName:$e,counterStyle:Zt,backgroundColor:e.backgroundColor??ow})}),st)})()]})}const Rw=`import { useCallback, useEffect, useLayoutEffect, useMemo, useRef, useState } from 'react';
|
|
21506
21502
|
import { createPortal } from 'react-dom';
|
|
21507
21503
|
import type React from 'react';
|
|
21508
21504
|
import { CommonComponentProps } from '../props';
|
|
@@ -25258,7 +25254,7 @@ export function Helix({
|
|
|
25258
25254
|
word-spacing ${rn}ms ease,
|
|
25259
25255
|
padding ${rn}ms ease;
|
|
25260
25256
|
}
|
|
25261
|
-
`}function Zs(e){return e?!e.startsWith("http://")&&!e.startsWith("https://")&&!e.startsWith("blob:")&&!e.startsWith("data:"):!1}function K$(e,t){var i;const n=(i=e.logo)==null?void 0:i.icon;return!e.logo||Zs(n)||!t?e:{...e,logo:{...e.logo,icon:t}}}function Y$(e){return`url("${e.replace(/\\/g,"\\\\").replace(/"/g,'\\"')}")`}function Q$(e){const t=e.trim().toLowerCase();return t.startsWith("data:image/svg+xml")||t.includes("image/svg+xml")?!0:t.includes(".svg")}function Z$(e){const t=Q$(e),[n,i]=s.useState(!1);return s.useEffect(()=>{if(t||!e.startsWith("blob:")){i(!1);return}let o=!1;return fetch(e).then(r=>r.blob()).then(async r=>{if(o)return;if(r.type.includes("svg")){i(!0);return}if(r.type.startsWith("image/")&&!r.type.includes("svg")){i(!1);return}const l=await r.text();o||i(/<svg[\s>]/i.test(l.trim()))}).catch(()=>{o||i(!1)}),()=>{o=!0}},[t,e]),t||n}function J$(e,t){const[n,i]=s.useState(yr(e)?e:null);return s.useEffect(()=>{if(!t||!e){i(null);return}if(yr(e)){i(e);return}let o=!1;return Ku(e).then(r=>{o||i(r)}).catch(()=>{o||i(null)}),()=>{o=!0}},[t,e]),t?n:null}function eC(e){const t=e.indexOf("#");if(t===-1)return"";try{return decodeURIComponent(e.slice(t+1))}catch{return e.slice(t+1)}}function tC(e){if(!e||e.startsWith("#"))return!0;try{return new URL(e,window.location.href).pathname===window.location.pathname}catch{return!1}}function Bp(e){if(!e)return null;const t=document.getElementById(e),n=document.querySelector(`[data-section-id="${CSS.escape(e)}"]`),i=t??n;return i instanceof HTMLElement?i:null}function Hd(e){const t=Bp(e);return t?(t.scrollIntoView({behavior:"smooth",block:"start"}),!0):!1}function nC(e,t,n={}){const{isEditor:i,isPreviewMode:o,item:r,pages:l,onLinkNavigate:c}=n,d=n.runAfterClose??(S=>S()),u=e.currentTarget.getAttribute("href")??"",p=eC(u),y=e.currentTarget.target==="_blank";if(r&&c){e.preventDefault(),e.stopPropagation();const S=Qs(r,l),m=Hp(r),h={mode:m.type==="url"?"url":"page",href:S.href||u,page:m.type==="page"?m.value:void 0,url:m.type==="url"?m.value:void 0,anchor:m.type==="anchor"?m.value.replace(/^#/,""):(m.anchor??"").replace(/^#/,""),target:S.target};h.target==="_blank"?c(h):d(()=>c(h)),t();return}if(i){e.preventDefault(),d(()=>Hd(p)),t();return}!y&&p&&tC(u)&&Bp(p)&&(e.preventDefault(),d(()=>Hd(p))),t()}const iC=["--cntrl-article-width","--cntrl-article-top","--cntrl-article-left","--cntrl-viewport-height"];function oC(e){let t=e;for(;t;){if(getComputedStyle(t).getPropertyValue("--cntrl-article-width").trim())return t;t=t.parentElement}return e}function rC(e){const t={},n=oC(e);if(!n)return t;const i=getComputedStyle(n);for(const o of iC){const r=i.getPropertyValue(o).trim();r&&(t[o]=r)}return t}function Wd(e,t,n,i,o){return a.jsx("span",{className:`${e}-link-text-box`,style:{width:o(n),maxWidth:"100%"},children:a.jsx("span",{className:i?`${e}-link-text-inner`:`${e}-link-text-inner-hidden`,style:{width:"100%"},children:t})})}function aC({settings:e,isEditor:t,isEditMode:n,isPreviewMode:i,activeEvent:o,currentState:r,isSwitchClone:l=!1,unavailableStates:c=[],layoutId:d,pages:u,onLinkNavigate:p,onUpdateSettings:y,onOpenChange:S}){var nc;const{prefix:m}=b.useScopedStyles(),h=s.useRef(null),x=s.useRef(null),w=s.useRef(null),F=s.useRef(null),v=s.useRef(null),P=s.useRef(0),M=s.useRef(null),K=s.useRef(null),X=s.useRef(d),j=s.useMemo(()=>q$(m),[m]),[N,_]=s.useState(!1),[T,L]=s.useState(!1),[Y,R]=s.useState(!1),I=$$(r),$=s.useMemo(()=>new Set(c),[c]),G=Ft=>!!(Ft&&$.has(Ft)),U=!!(t&&!i&&I==="open"&&!G("open"))||!(t&&!i)&&N,E=!!(t&&!i),f=U&&!E;Vl(f),s.useEffect(()=>{if(!U||!E)return;const Ft=document.documentElement,Yt=Ft.style.overflow;return Ft.style.overflow="hidden",()=>{Ft.style.overflow=Yt}},[U,E]);const Q=!G("compact")&&!G("onScroll"),q=!t||!!i&&!n,pe=o&&o!=="default"?o:void 0,k=Q&&I==="compact"?"compact":"default",[me,C]=s.useState(k),[ue,te]=s.useState(!1),fe=!n;k!==me&&(C(k),fe&&te(!0));const Pe=zp(e),{logo:de,logoMaxHeight:we=120/1440,logoPosition:V="left",panelHeight:ie=60/1440,backgroundColor:oe="#b3b3b3",logoColor:le="#000000",position:ve,horizontalAlign:Fe,verticalAlign:Ee,iconColor:Ce="#000000",showIcon:Se="on",iconSize:g=16/1440,linkColor:Z="#000000",openLinkColor:J="#000000",compactIconColor:re="#000000",compactLinkColor:he="#000000",compactLogoColor:z="#000000",compactBackgroundColor:B="#ffffff",compactLogoMaxHeight:ne=120/1440,compactLogoPosition:ce,compactPanelHeight:ee=60/1440,compactShowIcon:H="on",compactIconSize:be=16/1440,compactNavTextWidth:ae,compactNavTextPosition:W,compactNavTextOffset:ke,compactNavGap:ze,compactNavPaddingLeft:Xe=10/1440,compactNavPaddingRight:Ue=10/1440,compactFontFamily:Qe,compactFontSettings:We,compactFontSize:it,compactLineHeight:ye,compactLetterSpacing:Te=0,compactWordSpacing:Ve=0,compactTextAlign:Ze="left",compactTextAppearance:et,openLogoColor:at="#000000",menuBackgroundColor:tt="#ffffff",overlayColor:Ye="rgba(0, 0, 0, 0.45)",closeButtonColor:xt="#000000",effect:pt="fade",openPanelSize:De=100,textWidth:_e=280/1440,navTextWidth:He,navTextPosition:Ae="center",navTextOffset:Be=0,gap:Ie=0,navGap:mt,navPaddingLeft:ot=10/1440,navPaddingRight:Ct=10/1440,textPaddingLeft:rt=10/1440,textPaddingRight:St=10/1440,textPaddingTop:nt=10/1440,textPaddingBottom:Rt=10/1440,fontFamily:ht,fontSettings:Gt,fontSize:Zt,lineHeight:$e,letterSpacing:Ge=0,wordSpacing:ft=0,textAlign:Lt="left",textAppearance:wt,openFontFamily:vt,openFontSettings:Nt,openFontSize:Wt,openLineHeight:Dt,openLetterSpacing:Me,openWordSpacing:ct,openTextAlign:dt,openTextAppearance:kt,stateOverrides:Ke,link:st}=Pe,{horizontalAlign:It,verticalAlign:At}=W$({position:ve,horizontalAlign:Fe,verticalAlign:Ee}),ut=k==="compact",Xt=ut?ne:we,Ut=C$(ut?ce:V),Ot=ut?ee:ie,Bt=ut?be:g,jt=ut?ae:He,zt=T$(ut?W:Ae),Kt=(ut?ke:Be)??0,D=ut?ze:mt,Le=ut?Xe:ot,Ne=ut?Ue:Ct,Oe=jt??_e,yt=U||(ut?H:Se)!=="off",Tt=b.buildColorVars(m,{iconColor:Ce,closeButtonColor:xt,linkColor:Z,openLinkColor:J,compactIconColor:re,compactLinkColor:he,compactLogoColor:z,compactBackgroundColor:B,openLogoColor:at,menuBackgroundColor:tt,overlayColor:Ye,backgroundColor:oe,logoColor:le},V$,G$,Ke),Je=kd(ut?{fontFamily:Qe,fontSettings:We,fontSize:it,lineHeight:ye,letterSpacing:Te,wordSpacing:Ve,textAlign:Ze,textAppearance:et}:{fontFamily:ht,fontSettings:Gt,fontSize:Zt,lineHeight:$e,letterSpacing:Ge,wordSpacing:ft,textAlign:Lt,textAppearance:wt}),Pt=kd({fontFamily:vt,fontSettings:Nt,fontSize:Wt,lineHeight:Dt,letterSpacing:Me,wordSpacing:ct,textAlign:dt,textAppearance:kt},Je),$t=Ad(m,Je,t),_t=Ad(m,Pt,t),on=Pd(w,Ed(Je)),fn=Pd(F,Ed(Pt)),bn={..._t.css,whiteSpace:"pre-wrap",transform:Md(fn)},ui=_t.className,dn=Ft=>b.scalingValue(Ft,t),pi=D??Ie,Yn=Math.max(Le,ho),Sn=Math.max(Ne,ho),mi=Math.max(0,1-Bt),eo=Math.max(0,1-Bt),wn=n??!1,Qn=wn&&!U,to=s.useMemo(()=>Dp({textPaddingLeft:rt,textPaddingRight:St,textPaddingTop:nt,textPaddingBottom:Rt,fontSize:Pt.fontSize}),[rt,St,nt,Rt,Pt.fontSize]),no=Ft=>{const Yt=a.jsx("span",{className:ui,style:bn,children:Fd(Ft)});return Wd(m,Yt,_e,wn,dn)},qe=pt==="left"||pt==="right"?{width:`${De}%`}:{height:`${De}%`},A={...B$(to,t),...qe,alignItems:U$[It],justifyContent:X$[At]},se=s.useRef(e),ge=s.useRef(d),Re=s.useRef(null);Zs((nc=e.logo)==null?void 0:nc.icon)&&(Re.current=e.logo.icon),s.useEffect(()=>{var Nr;if(!y||!t){se.current=e,ge.current=d;return}const Ft=(Nr=e.logo)==null?void 0:Nr.icon;if(e.logo&&!Zs(Ft)&&!Re.current){se.current=e,ge.current=d;return}const Yt=_r=>{y(K$(_r,Re.current))};if(ge.current!==d){se.current=e,ge.current=d;const _r=_d(e);_r!==e&&Yt(_r);return}const cn=_d(e),yn=se.current,$n=yn!==e,Fn=$n?z$(cn,yn):cn;se.current=e;const io=cn!==e,Xo=$n&&O$(cn,Fn);!io&&!Xo||Yt(Fn)},[e,y,t,d]);const je=b.scalingValue(Bt,t),gt={width:je,height:je,minWidth:je,minHeight:je,maxWidth:je,maxHeight:je},Ht={...$t.css,textDecoration:"none",transform:Md(on)},qt=$t.className,sn=(de==null?void 0:de.mode)!=="Off",en=(de==null?void 0:de.icon)??"",gi=Z$(en),An=J$(en,gi),Zn=!!An,kr=dn(Math.min(Xt,Ot)),Go=!!(sn&&en&&Ut==="right")?"left":"right",Zl=Array.isArray(st)?st:[],Xa=[k!=="default"?`${m}-state-${k}`:"",U||I==="open"?`${m}-state-open`:"",pe&&pe!==k&&pe!==I?`${m}-state-${pe}`:""].filter(Boolean).join(" "),Jp=t&&!i?`${m}-editor`:"",Jl=q?`${m}-interactive`:"",em=fe&&(k!==me||ue)?`${m}-nav-state-anim`:"",tm=U?`${m}-open`:"",nm=s.useMemo(()=>rC(h.current),[T,U,d]),Ua=()=>{_(!1)},qa=!t||i,im=Ft=>{if(f){K.current=Ft;return}Ft()};s.useEffect(()=>{if(U)return;const Ft=K.current;K.current=null,Ft==null||Ft()},[U]);const ec=(Ft,Yt)=>{nC(Ft,Ua,{isEditor:t,isPreviewMode:i,item:Yt,pages:u,onLinkNavigate:p,runAfterClose:im})},om=()=>{t&&!i||_(Ft=>!Ft)},rm=Ft=>{Ft.pointerType==="touch"&&Ft.currentTarget.blur()},Ar=()=>{M.current!==null&&(window.clearTimeout(M.current),M.current=null)};s.useEffect(()=>{if(!ue)return;const Ft=window.setTimeout(()=>{te(!1)},rn);return()=>window.clearTimeout(Ft)},[ue,k]),s.useEffect(()=>{if(U){Ar(),L(!0);return}return P.current+=1,R(!1),Ar(),M.current=window.setTimeout(()=>{M.current=null,L(!1)},In),Ar},[U]),s.useLayoutEffect(()=>{X.current!==d&&(X.current=d,P.current+=1,Ar(),_(!1),R(!1),L(!1))},[d]),s.useLayoutEffect(()=>{var cn;if(!T||!U)return;const Ft=P.current+1;P.current=Ft,R(!1),(cn=x.current)==null||cn.offsetHeight;const Yt=requestAnimationFrame(()=>{P.current===Ft&&R(!0)});return()=>{cancelAnimationFrame(Yt)}},[T,U]),s.useLayoutEffect(()=>{if(!f||!T)return;const Ft=v.current;if(!Ft)return;const Yt=getComputedStyle(Ft).backgroundColor;if(!Yt)return;const cn=document.documentElement,{body:yn}=document,$n=cn.style.backgroundColor,Fn=yn.style.backgroundColor;return cn.style.backgroundColor=Yt,yn.style.backgroundColor=Yt,()=>{cn.style.backgroundColor=$n,yn.style.backgroundColor=Fn}},[f,T,Xa,tt,Ke]),s.useEffect(()=>{S==null||S(U)},[U,S]),s.useEffect(()=>{if(!U)return;const Ft=Yt=>{Yt.key==="Escape"&&(t&&i||Ua())};return window.addEventListener("keydown",Ft),()=>window.removeEventListener("keydown",Ft)},[U,t,i]),s.useEffect(()=>{t&&!i&&I!=="open"&&_(!1)},[t,i,I]),s.useEffect(()=>{i&&_(!1)},[i]);const tc=wn&&U,am=Ft=>Zl.filter(Yt=>M$(Yt,d)).map((Yt,cn)=>{const{label:yn,href:$n,target:Fn}=Qs(Yt,u),io=$n?a.jsx("a",{href:$n,target:Fn,rel:Fn==="_blank"?"noopener noreferrer":void 0,className:`${Ft} ${m}-has-href`,onClick:Xo=>ec(Xo,Yt),children:no(yn)}):a.jsx("span",{className:Ft,children:no(yn)});return a.jsxs(s.Fragment,{children:[cn>0&&a.jsx("div",{"data-controls":tc?"gap":void 0,"data-controls-axis":"y",className:tc?`${m}-gap-control`:void 0,style:{height:dn(Ie)}}),io]},cn)}),sm=T?a.jsxs("div",{ref:x,"data-selection":"none",className:[`${m}-lightbox`,`${m}-full-lightbox ${m}-effect-${pt}`,Y?`${m}-lightbox-active`:"",`${m}-lightbox-editor`,n?`${m}-lightbox-edit-mode`:"",Jl,Xa].filter(Boolean).join(" "),style:{...Tt,...nm},"aria-hidden":!Y,children:[a.jsx("div",{className:[`${m}-backdrop`,qa?`${m}-backdrop-clickable`:""].filter(Boolean).join(" "),"aria-hidden":"true",onClick:qa?Ua:void 0}),a.jsxs("nav",{className:[`${m}-panel`,qa?`${m}-panel-blocking`:""].filter(Boolean).join(" "),style:A,"aria-label":"Menu","data-lightbox-scrollable":"",children:[wn&&j$(m,to,Pt.fontSize,dn),am(`${m}-link`)]}),f?a.jsx("div",{ref:v,className:`${m}-safari-tint`,"aria-hidden":"true"}):null]}):null,lm=()=>a.jsx("button",{type:"button",className:`${m}-toggle`,onClick:om,onPointerUp:rm,"aria-expanded":U,"aria-label":U?"Close menu":"Open menu",children:a.jsx(k$,{className:`${m}-icon`,lineClassName:`${m}-icon-line`})}),Fr=Ft=>{const Yt=Ft==="left",cn=Yt?Le:Ne,yn=Yt?Yn:Sn,$n=Yt?mi:eo,Fn=ut?Yt?"compactNavPaddingLeft":"compactNavPaddingRight":Yt?"navPaddingLeft":"navPaddingRight";return a.jsx("div",{className:Yt?`${m}-nav-padding-left`:`${m}-nav-padding-right`,style:{width:dn(cn),flexShrink:0},children:Qn?a.jsx("div",{"data-controls":Fn,"data-controls-axis":"x","data-controls-variant":"column-padding",...Yt?{}:{"data-controls-reverse":""},"data-controls-min":"0","data-controls-max-fraction":String($n),className:`${m}-control-anchor`,style:{top:0,[Yt?"left":"right"]:0,width:dn(yn),height:"100%"}}):null})},cm=(Ft,Yt)=>{const{label:cn,href:yn,target:$n}=Qs(Ft,u),Fn=a.jsx("span",{className:qt,style:Ht,children:Fd(cn)}),io=Wd(m,Fn,Oe,Qn,dn),Xo=yn?a.jsx("a",{href:yn,target:$n,rel:$n==="_blank"?"noopener noreferrer":void 0,className:`${m}-nav-link ${m}-has-href`,onClick:Nr=>ec(Nr,Ft),children:io}):a.jsx("span",{className:`${m}-nav-link`,children:io});return a.jsxs(s.Fragment,{children:[Yt>0&&a.jsx("div",{"data-controls":Qn?ut?"compactNavGap":"navGap":void 0,"data-controls-axis":"x",className:Qn?`${m}-gap-control ${m}-nav-gap-control`:`${m}-nav-gap-control}`,style:{width:dn(pi),flexShrink:0}}),Xo]},Yt)},dm={...Tt,height:b.scalingValue(Ot,t),minHeight:b.scalingValue(Ot,t),[`--${m}-panel-height`]:b.scalingValue(Ot,t)},um=l&&k==="default"&&I!=="open"&&!i?dn(ie+b$):"0px";return a.jsxs("div",{ref:h,className:`${m}-root ${Xa} ${Jp} ${Jl} ${em}`.trim(),style:{width:"100%",height:"100%",lineHeight:0,fontSize:0,marginTop:um,...Tt},children:[a.jsx("style",{dangerouslySetInnerHTML:{__html:j}}),a.jsx("span",{ref:w,"aria-hidden":!0,style:Rd($t.css),children:"H"}),a.jsx("span",{ref:F,"aria-hidden":!0,style:Rd(_t.css),children:"H"}),a.jsx("div",{className:`${m}-nav-slide`,children:a.jsxs("div",{className:`${m}-nav-bar`,style:dm,children:[sn&&en?a.jsxs("div",{className:`${m}-nav-logo ${m}-nav-logo-${Ut}`,children:[Ut==="left"?Fr("left"):null,a.jsxs("div",{className:`${m}-nav-logo-inner${Zn?` ${m}-nav-logo-tinted`:""}`,style:{height:kr,...Zn&&An?{[`--${m}-logo-image`]:Y$(An)}:{}},children:[a.jsx("img",{src:Zn&&An?An:en,alt:"",className:`${m}-nav-logo-img`}),Zn?a.jsx("span",{className:`${m}-nav-logo-tint`,"aria-hidden":"true"}):null]}),Ut==="right"?Fr("right"):null]}):null,a.jsx("nav",{className:`${m}-nav-links ${m}-nav-links-${zt}`,style:{transform:I$(zt,Kt,t)},"aria-label":"Navigation",children:a.jsx("div",{className:`${m}-nav-links-inner`,children:Zl.filter(Ft=>P$(Ft,k,d)).map((Ft,Yt)=>cm(Ft,Yt))})})]})}),sm,a.jsxs("div",{className:`${m}-nav-toggle-wrap ${m}-nav-toggle-wrap-${Go}`,children:[Go==="left"?Fr("left"):null,yt?a.jsx("div",{className:`${m}-root ${tm}`.trim(),style:gt,children:lm()}):null,Go==="right"?Fr("right"):null]})]})}const sC=`import { Fragment, useEffect, useLayoutEffect, useMemo, useRef, useState, type CSSProperties, type MouseEvent, type PointerEvent, type ReactNode } from 'react';
|
|
25257
|
+
`}function Zs(e){return e?!e.startsWith("http://")&&!e.startsWith("https://")&&!e.startsWith("blob:")&&!e.startsWith("data:"):!1}function K$(e,t){var i;const n=(i=e.logo)==null?void 0:i.icon;return!e.logo||Zs(n)||!t?e:{...e,logo:{...e.logo,icon:t}}}function Y$(e){return`url("${e.replace(/\\/g,"\\\\").replace(/"/g,'\\"')}")`}function Q$(e){const t=e.trim().toLowerCase();return t.startsWith("data:image/svg+xml")||t.includes("image/svg+xml")?!0:t.includes(".svg")}function Z$(e){const t=Q$(e),[n,i]=s.useState(!1);return s.useEffect(()=>{if(t||!e.startsWith("blob:")){i(!1);return}let o=!1;return fetch(e).then(r=>r.blob()).then(async r=>{if(o)return;if(r.type.includes("svg")){i(!0);return}if(r.type.startsWith("image/")&&!r.type.includes("svg")){i(!1);return}const l=await r.text();o||i(/<svg[\s>]/i.test(l.trim()))}).catch(()=>{o||i(!1)}),()=>{o=!0}},[t,e]),t||n}function J$(e,t){const[n,i]=s.useState(yr(e)?e:null);return s.useEffect(()=>{if(!t||!e){i(null);return}if(yr(e)){i(e);return}let o=!1;return Ku(e).then(r=>{o||i(r)}).catch(()=>{o||i(null)}),()=>{o=!0}},[t,e]),t?n:null}function eC(e){const t=e.indexOf("#");if(t===-1)return"";try{return decodeURIComponent(e.slice(t+1))}catch{return e.slice(t+1)}}function tC(e){if(!e||e.startsWith("#"))return!0;try{return new URL(e,window.location.href).pathname===window.location.pathname}catch{return!1}}function Bp(e){if(!e)return null;const t=document.getElementById(e),n=document.querySelector(`[data-section-id="${CSS.escape(e)}"]`),i=t??n;return i instanceof HTMLElement?i:null}function Hd(e){const t=Bp(e);return t?(t.scrollIntoView({behavior:"smooth",block:"start"}),!0):!1}function nC(e,t,n={}){const{isEditor:i,isPreviewMode:o,item:r,pages:l,onLinkNavigate:c}=n,d=n.runAfterClose??(S=>S()),u=e.currentTarget.getAttribute("href")??"",p=eC(u),y=e.currentTarget.target==="_blank";if(r&&c){e.preventDefault(),e.stopPropagation();const S=Qs(r,l),m=Hp(r),h={mode:m.type==="url"?"url":"page",href:S.href||u,page:m.type==="page"?m.value:void 0,url:m.type==="url"?m.value:void 0,anchor:m.type==="anchor"?m.value.replace(/^#/,""):(m.anchor??"").replace(/^#/,""),target:S.target};h.target==="_blank"?c(h):d(()=>c(h)),t();return}if(i){e.preventDefault(),d(()=>Hd(p)),t();return}!y&&p&&tC(u)&&Bp(p)&&(e.preventDefault(),d(()=>Hd(p))),t()}const iC=["--cntrl-article-width","--cntrl-article-top","--cntrl-article-left","--cntrl-viewport-height"];function oC(e){let t=e;for(;t;){if(getComputedStyle(t).getPropertyValue("--cntrl-article-width").trim())return t;t=t.parentElement}return e}function rC(e){const t={},n=oC(e);if(!n)return t;const i=getComputedStyle(n);for(const o of iC){const r=i.getPropertyValue(o).trim();r&&(t[o]=r)}return t}function Wd(e,t,n,i,o){return a.jsx("span",{className:`${e}-link-text-box`,style:{width:o(n),maxWidth:"100%"},children:a.jsx("span",{className:i?`${e}-link-text-inner`:`${e}-link-text-inner-hidden`,style:{width:"100%"},children:t})})}function aC({settings:e,isEditor:t,isEditMode:n,isPreviewMode:i,activeEvent:o,currentState:r,isSwitchClone:l=!1,unavailableStates:c=[],layoutId:d,pages:u,onLinkNavigate:p,onUpdateSettings:y,onOpenChange:S}){var nc;const{prefix:m}=b.useScopedStyles(),h=s.useRef(null),x=s.useRef(null),w=s.useRef(null),F=s.useRef(null),v=s.useRef(null),P=s.useRef(0),M=s.useRef(null),K=s.useRef(null),X=s.useRef(d),j=s.useMemo(()=>q$(m),[m]),[N,_]=s.useState(!1),[T,L]=s.useState(!1),[Y,R]=s.useState(!1),I=$$(r),$=s.useMemo(()=>new Set(c),[c]),G=Ft=>!!(Ft&&$.has(Ft)),U=!!(t&&!i&&I==="open"&&!G("open"))||!(t&&!i)&&N,E=!!(t&&!i),f=U&&!E;Vl(f),s.useEffect(()=>{if(!U||!E)return;const Ft=document.documentElement,Yt=Ft.style.overflow;return Ft.style.overflow="hidden",()=>{Ft.style.overflow=Yt}},[U,E]);const Q=!G("compact")&&!G("onScroll"),q=!t||!!i&&!n,pe=o&&o!=="default"?o:void 0,k=Q&&I==="compact"?"compact":"default",[me,C]=s.useState(k),[ue,te]=s.useState(!1),fe=!n;k!==me&&(C(k),fe&&te(!0));const Pe=zp(e),{logo:de,logoMaxHeight:we=120/1440,logoPosition:V="left",panelHeight:ie=60/1440,backgroundColor:oe="#b3b3b3",logoColor:le="#000000",position:ve,horizontalAlign:Fe,verticalAlign:Ee,iconColor:Ce="#000000",showIcon:Se="on",iconSize:g=16/1440,linkColor:Z="#000000",openLinkColor:J="#000000",compactIconColor:re="#000000",compactLinkColor:he="#000000",compactLogoColor:z="#000000",compactBackgroundColor:B="#ffffff",compactLogoMaxHeight:ne=120/1440,compactLogoPosition:ce,compactPanelHeight:ee=60/1440,compactShowIcon:H="on",compactIconSize:be=16/1440,compactNavTextWidth:ae,compactNavTextPosition:W,compactNavTextOffset:ke,compactNavGap:ze,compactNavPaddingLeft:Xe=10/1440,compactNavPaddingRight:Ue=10/1440,compactFontFamily:Qe,compactFontSettings:We,compactFontSize:it,compactLineHeight:ye,compactLetterSpacing:Te=0,compactWordSpacing:Ve=0,compactTextAlign:Ze="left",compactTextAppearance:et,openLogoColor:at="#000000",menuBackgroundColor:tt="#ffffff",overlayColor:Ye="rgba(0, 0, 0, 0.45)",closeButtonColor:xt="#000000",effect:pt="fade",openPanelSize:De=100,textWidth:_e=280/1440,navTextWidth:He,navTextPosition:Ae="center",navTextOffset:Be=0,gap:Ie=0,navGap:mt,navPaddingLeft:ot=10/1440,navPaddingRight:Ct=10/1440,textPaddingLeft:rt=10/1440,textPaddingRight:St=10/1440,textPaddingTop:nt=10/1440,textPaddingBottom:Rt=10/1440,fontFamily:ht,fontSettings:Vt,fontSize:Zt,lineHeight:$e,letterSpacing:Ge=0,wordSpacing:ft=0,textAlign:Lt="left",textAppearance:wt,openFontFamily:vt,openFontSettings:Nt,openFontSize:Wt,openLineHeight:Dt,openLetterSpacing:Me,openWordSpacing:ct,openTextAlign:dt,openTextAppearance:kt,stateOverrides:Ke,link:st}=Pe,{horizontalAlign:It,verticalAlign:At}=W$({position:ve,horizontalAlign:Fe,verticalAlign:Ee}),ut=k==="compact",Gt=ut?ne:we,Ut=C$(ut?ce:V),Ot=ut?ee:ie,Bt=ut?be:g,Xt=ut?ae:He,zt=T$(ut?W:Ae),Kt=(ut?ke:Be)??0,D=ut?ze:mt,Le=ut?Xe:ot,Ne=ut?Ue:Ct,Oe=Xt??_e,yt=U||(ut?H:Se)!=="off",Tt=b.buildColorVars(m,{iconColor:Ce,closeButtonColor:xt,linkColor:Z,openLinkColor:J,compactIconColor:re,compactLinkColor:he,compactLogoColor:z,compactBackgroundColor:B,openLogoColor:at,menuBackgroundColor:tt,overlayColor:Ye,backgroundColor:oe,logoColor:le},V$,G$,Ke),Je=kd(ut?{fontFamily:Qe,fontSettings:We,fontSize:it,lineHeight:ye,letterSpacing:Te,wordSpacing:Ve,textAlign:Ze,textAppearance:et}:{fontFamily:ht,fontSettings:Vt,fontSize:Zt,lineHeight:$e,letterSpacing:Ge,wordSpacing:ft,textAlign:Lt,textAppearance:wt}),Pt=kd({fontFamily:vt,fontSettings:Nt,fontSize:Wt,lineHeight:Dt,letterSpacing:Me,wordSpacing:ct,textAlign:dt,textAppearance:kt},Je),$t=Ad(m,Je,t),_t=Ad(m,Pt,t),on=Pd(w,Ed(Je)),fn=Pd(F,Ed(Pt)),bn={..._t.css,whiteSpace:"pre-wrap",transform:Md(fn)},ui=_t.className,dn=Ft=>b.scalingValue(Ft,t),pi=D??Ie,Yn=Math.max(Le,ho),Sn=Math.max(Ne,ho),mi=Math.max(0,1-Bt),eo=Math.max(0,1-Bt),wn=n??!1,Qn=wn&&!U,to=s.useMemo(()=>Dp({textPaddingLeft:rt,textPaddingRight:St,textPaddingTop:nt,textPaddingBottom:Rt,fontSize:Pt.fontSize}),[rt,St,nt,Rt,Pt.fontSize]),no=Ft=>{const Yt=a.jsx("span",{className:ui,style:bn,children:Fd(Ft)});return Wd(m,Yt,_e,wn,dn)},qe=pt==="left"||pt==="right"?{width:`${De}%`}:{height:`${De}%`},A={...B$(to,t),...qe,alignItems:U$[It],justifyContent:X$[At]},se=s.useRef(e),ge=s.useRef(d),Re=s.useRef(null);Zs((nc=e.logo)==null?void 0:nc.icon)&&(Re.current=e.logo.icon),s.useEffect(()=>{var Nr;if(!y||!t){se.current=e,ge.current=d;return}const Ft=(Nr=e.logo)==null?void 0:Nr.icon;if(e.logo&&!Zs(Ft)&&!Re.current){se.current=e,ge.current=d;return}const Yt=_r=>{y(K$(_r,Re.current))};if(ge.current!==d){se.current=e,ge.current=d;const _r=_d(e);_r!==e&&Yt(_r);return}const cn=_d(e),yn=se.current,$n=yn!==e,Fn=$n?z$(cn,yn):cn;se.current=e;const io=cn!==e,Xo=$n&&O$(cn,Fn);!io&&!Xo||Yt(Fn)},[e,y,t,d]);const je=b.scalingValue(Bt,t),gt={width:je,height:je,minWidth:je,minHeight:je,maxWidth:je,maxHeight:je},Ht={...$t.css,textDecoration:"none",transform:Md(on)},qt=$t.className,sn=(de==null?void 0:de.mode)!=="Off",en=(de==null?void 0:de.icon)??"",gi=Z$(en),An=J$(en,gi),Zn=!!An,kr=dn(Math.min(Gt,Ot)),Go=!!(sn&&en&&Ut==="right")?"left":"right",Zl=Array.isArray(st)?st:[],Xa=[k!=="default"?`${m}-state-${k}`:"",U||I==="open"?`${m}-state-open`:"",pe&&pe!==k&&pe!==I?`${m}-state-${pe}`:""].filter(Boolean).join(" "),Jp=t&&!i?`${m}-editor`:"",Jl=q?`${m}-interactive`:"",em=fe&&(k!==me||ue)?`${m}-nav-state-anim`:"",tm=U?`${m}-open`:"",nm=s.useMemo(()=>rC(h.current),[T,U,d]),Ua=()=>{_(!1)},qa=!t||i,im=Ft=>{if(f){K.current=Ft;return}Ft()};s.useEffect(()=>{if(U)return;const Ft=K.current;K.current=null,Ft==null||Ft()},[U]);const ec=(Ft,Yt)=>{nC(Ft,Ua,{isEditor:t,isPreviewMode:i,item:Yt,pages:u,onLinkNavigate:p,runAfterClose:im})},om=()=>{t&&!i||_(Ft=>!Ft)},rm=Ft=>{Ft.pointerType==="touch"&&Ft.currentTarget.blur()},Ar=()=>{M.current!==null&&(window.clearTimeout(M.current),M.current=null)};s.useEffect(()=>{if(!ue)return;const Ft=window.setTimeout(()=>{te(!1)},rn);return()=>window.clearTimeout(Ft)},[ue,k]),s.useEffect(()=>{if(U){Ar(),L(!0);return}return P.current+=1,R(!1),Ar(),M.current=window.setTimeout(()=>{M.current=null,L(!1)},In),Ar},[U]),s.useLayoutEffect(()=>{X.current!==d&&(X.current=d,P.current+=1,Ar(),_(!1),R(!1),L(!1))},[d]),s.useLayoutEffect(()=>{var cn;if(!T||!U)return;const Ft=P.current+1;P.current=Ft,R(!1),(cn=x.current)==null||cn.offsetHeight;const Yt=requestAnimationFrame(()=>{P.current===Ft&&R(!0)});return()=>{cancelAnimationFrame(Yt)}},[T,U]),s.useLayoutEffect(()=>{if(!f||!T)return;const Ft=v.current;if(!Ft)return;const Yt=getComputedStyle(Ft).backgroundColor;if(!Yt)return;const cn=document.documentElement,{body:yn}=document,$n=cn.style.backgroundColor,Fn=yn.style.backgroundColor;return cn.style.backgroundColor=Yt,yn.style.backgroundColor=Yt,()=>{cn.style.backgroundColor=$n,yn.style.backgroundColor=Fn}},[f,T,Xa,tt,Ke]),s.useEffect(()=>{S==null||S(U)},[U,S]),s.useEffect(()=>{if(!U)return;const Ft=Yt=>{Yt.key==="Escape"&&(t&&i||Ua())};return window.addEventListener("keydown",Ft),()=>window.removeEventListener("keydown",Ft)},[U,t,i]),s.useEffect(()=>{t&&!i&&I!=="open"&&_(!1)},[t,i,I]),s.useEffect(()=>{i&&_(!1)},[i]);const tc=wn&&U,am=Ft=>Zl.filter(Yt=>M$(Yt,d)).map((Yt,cn)=>{const{label:yn,href:$n,target:Fn}=Qs(Yt,u),io=$n?a.jsx("a",{href:$n,target:Fn,rel:Fn==="_blank"?"noopener noreferrer":void 0,className:`${Ft} ${m}-has-href`,onClick:Xo=>ec(Xo,Yt),children:no(yn)}):a.jsx("span",{className:Ft,children:no(yn)});return a.jsxs(s.Fragment,{children:[cn>0&&a.jsx("div",{"data-controls":tc?"gap":void 0,"data-controls-axis":"y",className:tc?`${m}-gap-control`:void 0,style:{height:dn(Ie)}}),io]},cn)}),sm=T?a.jsxs("div",{ref:x,"data-selection":"none",className:[`${m}-lightbox`,`${m}-full-lightbox ${m}-effect-${pt}`,Y?`${m}-lightbox-active`:"",`${m}-lightbox-editor`,n?`${m}-lightbox-edit-mode`:"",Jl,Xa].filter(Boolean).join(" "),style:{...Tt,...nm},"aria-hidden":!Y,children:[a.jsx("div",{className:[`${m}-backdrop`,qa?`${m}-backdrop-clickable`:""].filter(Boolean).join(" "),"aria-hidden":"true",onClick:qa?Ua:void 0}),a.jsxs("nav",{className:[`${m}-panel`,qa?`${m}-panel-blocking`:""].filter(Boolean).join(" "),style:A,"aria-label":"Menu","data-lightbox-scrollable":"",children:[wn&&j$(m,to,Pt.fontSize,dn),am(`${m}-link`)]}),f?a.jsx("div",{ref:v,className:`${m}-safari-tint`,"aria-hidden":"true"}):null]}):null,lm=()=>a.jsx("button",{type:"button",className:`${m}-toggle`,onClick:om,onPointerUp:rm,"aria-expanded":U,"aria-label":U?"Close menu":"Open menu",children:a.jsx(k$,{className:`${m}-icon`,lineClassName:`${m}-icon-line`})}),Fr=Ft=>{const Yt=Ft==="left",cn=Yt?Le:Ne,yn=Yt?Yn:Sn,$n=Yt?mi:eo,Fn=ut?Yt?"compactNavPaddingLeft":"compactNavPaddingRight":Yt?"navPaddingLeft":"navPaddingRight";return a.jsx("div",{className:Yt?`${m}-nav-padding-left`:`${m}-nav-padding-right`,style:{width:dn(cn),flexShrink:0},children:Qn?a.jsx("div",{"data-controls":Fn,"data-controls-axis":"x","data-controls-variant":"column-padding",...Yt?{}:{"data-controls-reverse":""},"data-controls-min":"0","data-controls-max-fraction":String($n),className:`${m}-control-anchor`,style:{top:0,[Yt?"left":"right"]:0,width:dn(yn),height:"100%"}}):null})},cm=(Ft,Yt)=>{const{label:cn,href:yn,target:$n}=Qs(Ft,u),Fn=a.jsx("span",{className:qt,style:Ht,children:Fd(cn)}),io=Wd(m,Fn,Oe,Qn,dn),Xo=yn?a.jsx("a",{href:yn,target:$n,rel:$n==="_blank"?"noopener noreferrer":void 0,className:`${m}-nav-link ${m}-has-href`,onClick:Nr=>ec(Nr,Ft),children:io}):a.jsx("span",{className:`${m}-nav-link`,children:io});return a.jsxs(s.Fragment,{children:[Yt>0&&a.jsx("div",{"data-controls":Qn?ut?"compactNavGap":"navGap":void 0,"data-controls-axis":"x",className:Qn?`${m}-gap-control ${m}-nav-gap-control`:`${m}-nav-gap-control}`,style:{width:dn(pi),flexShrink:0}}),Xo]},Yt)},dm={...Tt,height:b.scalingValue(Ot,t),minHeight:b.scalingValue(Ot,t),[`--${m}-panel-height`]:b.scalingValue(Ot,t)},um=l&&k==="default"&&I!=="open"&&!i?dn(ie+b$):"0px";return a.jsxs("div",{ref:h,className:`${m}-root ${Xa} ${Jp} ${Jl} ${em}`.trim(),style:{width:"100%",height:"100%",lineHeight:0,fontSize:0,marginTop:um,...Tt},children:[a.jsx("style",{dangerouslySetInnerHTML:{__html:j}}),a.jsx("span",{ref:w,"aria-hidden":!0,style:Rd($t.css),children:"H"}),a.jsx("span",{ref:F,"aria-hidden":!0,style:Rd(_t.css),children:"H"}),a.jsx("div",{className:`${m}-nav-slide`,children:a.jsxs("div",{className:`${m}-nav-bar`,style:dm,children:[sn&&en?a.jsxs("div",{className:`${m}-nav-logo ${m}-nav-logo-${Ut}`,children:[Ut==="left"?Fr("left"):null,a.jsxs("div",{className:`${m}-nav-logo-inner${Zn?` ${m}-nav-logo-tinted`:""}`,style:{height:kr,...Zn&&An?{[`--${m}-logo-image`]:Y$(An)}:{}},children:[a.jsx("img",{src:Zn&&An?An:en,alt:"",className:`${m}-nav-logo-img`}),Zn?a.jsx("span",{className:`${m}-nav-logo-tint`,"aria-hidden":"true"}):null]}),Ut==="right"?Fr("right"):null]}):null,a.jsx("nav",{className:`${m}-nav-links ${m}-nav-links-${zt}`,style:{transform:I$(zt,Kt,t)},"aria-label":"Navigation",children:a.jsx("div",{className:`${m}-nav-links-inner`,children:Zl.filter(Ft=>P$(Ft,k,d)).map((Ft,Yt)=>cm(Ft,Yt))})})]})}),sm,a.jsxs("div",{className:`${m}-nav-toggle-wrap ${m}-nav-toggle-wrap-${Go}`,children:[Go==="left"?Fr("left"):null,yt?a.jsx("div",{className:`${m}-root ${tm}`.trim(),style:gt,children:lm()}):null,Go==="right"?Fr("right"):null]})]})}const sC=`import { Fragment, useEffect, useLayoutEffect, useMemo, useRef, useState, type CSSProperties, type MouseEvent, type PointerEvent, type ReactNode } from 'react';
|
|
25262
25258
|
import { CommonComponentProps } from '../props';
|
|
25263
25259
|
import { buildColorVars, scalingValue, useScopedStyles } from '../utils';
|
|
25264
25260
|
import { useLightboxScrollLock } from '../utils/useLightboxScrollLock';
|
|
@@ -27899,8 +27895,8 @@ export function Burger({
|
|
|
27899
27895
|
</div>
|
|
27900
27896
|
);
|
|
27901
27897
|
}
|
|
27902
|
-
`;function tr(e){return{type:"number",scope:"layout",title:e,min:0,max:100,display:{type:"range-control"}}}const ji={fontSettings:{type:"object",display:{type:"font-settings-weight",hideLabel:!0,useTabDesign:!0},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 bi(e,t){return e?`${e}${t.charAt(0).toUpperCase()}${t.slice(1)}`:t}function ql(e){return{[bi(e,"fontFamily")]:{type:"string",scope:"common",title:"",display:{type:"font-family-select",hideLabel:!0,useTabDesign:!0}},[bi(e,"fontSettings")]:{...ji.fontSettings,scope:"common",title:""},[bi(e,"fontSize")]:{...ji.fontSize,scope:"layout",title:""},[bi(e,"lineHeight")]:{...ji.lineHeight,scope:"layout",title:""},[bi(e,"letterSpacing")]:{...ji.letterSpacing,scope:"layout",title:""},[bi(e,"wordSpacing")]:{...ji.wordSpacing,scope:"layout",title:""},[bi(e,"textAlign")]:{...ji.textAlign,scope:"layout",title:""},[bi(e,"textAppearance")]:{...ji.textAppearance,scope:"layout",title:""}}}const lC=ql(""),cC=ql("open"),dC=ql("compact"),uC=["__componentName__",{type:"row",items:["panelHeight","navTextWidth"]},{type:"row",title:"",items:["navTextPosition","navTextOffset"]},{type:"row",title:"Logo",items:["logoMaxHeight","logoPosition"]},{type:"row",title:"Hamburger",items:["iconSize","showIcon"]},"fontFamily","fontSettings",{type:"row",items:["fontSize","lineHeight","letterSpacing","wordSpacing"]},"textAlign","textAppearance","navGap","navPaddingLeft","navPaddingRight"],pC=["__componentName__",{type:"row",items:["compactPanelHeight","compactNavTextWidth"]},{type:"row",title:"",items:["compactNavTextPosition","compactNavTextOffset"]},{type:"row",title:"Logo",items:["compactLogoMaxHeight","compactLogoPosition"]},{type:"row",title:"Hamburger",items:["compactIconSize","compactShowIcon"]},"compactFontFamily","compactFontSettings",{type:"row",items:["compactFontSize","compactLineHeight","compactLetterSpacing","compactWordSpacing"]},"compactTextAlign","compactTextAppearance","compactNavGap","compactNavPaddingLeft","compactNavPaddingRight"],mC=["__componentName__",{type:"row",title:"Text",items:["textWidth","position"]},{type:"row",title:"Menu",items:["openPanelSize","effect"]},"openFontFamily","openFontSettings",{type:"row",items:["openFontSize","openLineHeight","openLetterSpacing","openWordSpacing"]},"openTextAlign","openTextAppearance"],ei={textTransform:"none",textDecoration:"none",fontVariant:"normal"},Ms={fontWeight:400,fontStyle:"normal"},ea={d:"Always",t:"Open Only",m:"Open Only"},gC=["left-top","center-top","right-top","left-center","center","right-center","left-bottom","center-bottom","right-bottom"],hC=["iconColor","logoColor","linkColor","backgroundColor"],fC={type:"object",version:1,settings:{sizing:"auto manual",properties:{link:{type:"array",scope:"common",display:{type:"page-url-link"},items:{type:"object",properties:{link:{type:"object",properties:{type:{type:"string",enum:["url","page","anchor"]},value:{type:"string",message:"Paste URL here..."},target:{type:"string",enum:["blank","self"]},anchor:{type:"string"}}},label:{type:"string"},showIn:{type:"string",scope:"layout",enum:["Always","Open Only","Open and Compact","Default and Open","Default and Compact"]}}}},logo:{type:"object",scope:"common",title:"Logo",display:{type:"button-icon-switch"},properties:{mode:{type:"string",enum:["On","Off"]},icon:{type:["string","null"],title:"Logo",display:{type:"settings-image-input"}}}},logoMaxHeight:{type:"number",scope:"layout",title:"Max Height",display:{type:"numeric-input"},min:0,max:9999},logoPosition:{type:"string",scope:"layout",title:"Position",display:{type:"toggle-cycle",enum:["left","center","right"]}},compactLogoPosition:{type:"string",scope:"layout",title:"Position",display:{type:"toggle-cycle",enum:["left","center","right"]}},logoColor:{type:"string",scope:"common",title:"Logo Default",titleByState:{default:"Logo Default",hover:"Logo Hover"},display:{type:"palette-color-picker"}},panelHeight:{type:"number",scope:"layout",title:"Menu Height",display:{type:"numeric-input"},min:0,max:9999},backgroundColor:{type:"string",scope:"common",title:"BG Default",display:{type:"palette-color-picker"}},iconColor:{type:"string",scope:"common",title:"Icon Default",titleByState:{default:"Icon Default",hover:"Icon Hover"},display:{type:"palette-color-picker"}},showIcon:{type:"string",scope:"layout",title:"Show",display:{type:"toggle-cycle",enum:["on","off"]}},iconSize:{type:"number",scope:"layout",title:"Size",display:{type:"numeric-input"},min:0,max:9999},linkColor:{type:"string",scope:"common",title:"Text Default",titleByState:{default:"Text Default",hover:"Text Hover"},display:{type:"palette-color-picker"}},compactShowIcon:{type:"string",scope:"layout",title:"Show",display:{type:"toggle-cycle",enum:["on","off"]}},compactIconColor:{type:"string",scope:"common",title:"Icon Default",titleByState:{compact:"Icon Default","compact-hover":"Icon Hover"},display:{type:"palette-color-picker"}},compactLinkColor:{type:"string",scope:"common",title:"Text Default",titleByState:{compact:"Text Default","compact-hover":"Text Hover"},display:{type:"palette-color-picker"}},compactLogoColor:{type:"string",scope:"common",title:"Logo Default",titleByState:{compact:"Logo Default","compact-hover":"Logo Hover"},display:{type:"palette-color-picker"}},compactBackgroundColor:{type:"string",scope:"common",title:"BG Default",display:{type:"palette-color-picker"}},openLinkColor:{type:"string",scope:"common",title:"Text Default",titleByState:{open:"Text Default","open-hover":"Text Hover"},display:{type:"palette-color-picker"}},openLogoColor:{type:"string",scope:"common",title:"Logo Default",titleByState:{open:"Logo Default","open-hover":"Logo Hover"},display:{type:"palette-color-picker"}},menuBackgroundColor:{type:"string",scope:"common",title:"BG Default",display:{type:"palette-color-picker"}},overlayColor:{type:"string",scope:"common",title:"Overlay Default",display:{type:"palette-color-picker"}},closeButtonColor:{type:"string",scope:"common",title:"Close Default",titleByState:{open:"Close Default","open-hover":"Close Hover"},display:{type:"palette-color-picker"}},effect:{type:"string",scope:"layout",title:"Effect",display:{type:"toggle-cycle",enum:["fade","left","top","right","bottom"]}},openPanelSize:{type:"number",scope:"layout",title:"Height",display:{type:"percentage-input"},min:0,max:100},textWidth:{type:"number",scope:"layout",title:"Width",display:{type:"numeric-input"},min:0,max:9999},navTextWidth:{type:"number",scope:"layout",title:"Text width",display:{type:"numeric-input"},min:0,max:9999},navTextPosition:{type:"string",scope:"layout",title:"Position",display:{type:"toggle-cycle",enum:["left","center","right"]}},navTextOffset:{type:"number",scope:"layout",title:"Offset",display:{type:"numeric-input"},min:-9999,max:9999},position:{type:"string",scope:"layout",title:"Position",display:{type:"toggle-cycle",enum:[...gC]}},stateOverrides:{type:"object",scope:"common"},gap:tr("Gap"),navGap:{type:"number",scope:"layout",title:"Nav gap",min:0,max:100,display:{type:"range-control",visible:!1}},navPaddingLeft:{type:"number",scope:"layout",title:"Nav padding left",min:0,max:100,display:{type:"range-control",visible:!1}},navPaddingRight:{type:"number",scope:"layout",title:"Nav padding right",min:0,max:100,display:{type:"range-control",visible:!1}},textPaddingLeft:tr("Text padding left"),textPaddingRight:tr("Text padding right"),textPaddingTop:tr("Text padding top"),textPaddingBottom:tr("Text padding bottom"),compactLogoMaxHeight:{type:"number",scope:"layout",title:"Max Height",display:{type:"numeric-input"},min:0,max:9999},compactPanelHeight:{type:"number",scope:"layout",title:"Menu Height",display:{type:"numeric-input"},min:0,max:9999},compactIconSize:{type:"number",scope:"layout",title:"Size",display:{type:"numeric-input"},min:0,max:9999},compactNavTextWidth:{type:"number",scope:"layout",title:"Text width",display:{type:"numeric-input"},min:0,max:9999},compactNavTextPosition:{type:"string",scope:"layout",title:"Position",display:{type:"toggle-cycle",enum:["left","center","right"]}},compactNavTextOffset:{type:"number",scope:"layout",title:"Offset",display:{type:"numeric-input"},min:-9999,max:9999},compactNavGap:{type:"number",scope:"layout",title:"Nav gap",min:0,max:100,display:{type:"range-control",visible:!1}},compactNavPaddingLeft:{type:"number",scope:"layout",title:"Nav padding left",min:0,max:100,display:{type:"range-control",visible:!1}},compactNavPaddingRight:{type:"number",scope:"layout",title:"Nav padding right",min:0,max:100,display:{type:"range-control",visible:!1}},...lC,...cC,...dC},defaults:{link:[{link:{type:"page",value:"",target:"self"},label:"Home",showIn:ea},{link:{type:"page",value:"",target:"self"},label:"Works",showIn:ea},{link:{type:"page",value:"",target:"self"},label:"About",showIn:ea},{link:{type:"page",value:"",target:"self"},label:"Contact",showIn:ea}],logo:{mode:"On",icon:"01M3QM74XE09DSJCWGD1XM6Y45"},backgroundColor:"#ffffff",logoColor:"#000000",iconColor:"#000000",linkColor:"#000000",openLinkColor:"#000000",compactIconColor:"#000000",compactLinkColor:"#000000",compactLogoColor:"#000000",compactBackgroundColor:"#ffffff",openLogoColor:"#000000",menuBackgroundColor:"#ffffff",overlayColor:"rgba(0, 0, 0, 0.45)",closeButtonColor:"#000000",effect:"fade",showIcon:"on",compactShowIcon:"on",logoPosition:"left",compactLogoPosition:"left",navTextPosition:"center",compactNavTextPosition:"center",navTextOffset:0,compactNavTextOffset:0,position:"left-top",fontFamily:"Goudy Bookletter 1911",fontSettings:Ms,textAlign:"left",openFontFamily:"Goudy Bookletter 1911",openFontSettings:Ms,openTextAlign:"left",compactFontFamily:"Goudy Bookletter 1911",compactFontSettings:Ms,compactTextAlign:"left",stateOverrides:{hover:{linkColor:"#666666",iconColor:"#666666",logoColor:"#666666"},"open-hover":{closeButtonColor:"#666666"}}},displayRules:[{if:{name:"logo.mode",value:"Off"},then:{name:"properties.logoMaxHeight.display.visible",value:!1}},{if:{name:"logo.mode",value:"Off"},then:{name:"properties.logoPosition.display.visible",value:!1}},{if:{name:"logo.mode",value:"Off"},then:{name:"properties.compactLogoMaxHeight.display.visible",value:!1}},{if:{name:"logo.mode",value:"Off"},then:{name:"properties.compactLogoPosition.display.visible",value:!1}},{if:{name:"logo.mode",value:"Off"},then:{name:"properties.logoColor.display.visible",value:!1}},{if:{name:"logo.mode",value:"Off"},then:{name:"properties.compactLogoColor.display.visible",value:!1}},{if:{name:"logo.mode",value:"Off"},then:{name:"properties.openLogoColor.display.visible",value:!1}},{if:{name:"effect",value:"left"},then:{name:"properties.openPanelSize.title",value:"Width"}},{if:{name:"effect",value:"right"},then:{name:"properties.openPanelSize.title",value:"Width"}},{if:{name:"showIcon",value:"off"},then:{name:"properties.iconSize.display.visible",value:!1}},{if:{name:"showIcon",value:"off"},then:{name:"properties.iconColor.display.visible",value:!1}},{if:{name:"compactShowIcon",value:"off"},then:{name:"properties.compactIconSize.display.visible",value:!1}},{if:{name:"compactShowIcon",value:"off"},then:{name:"properties.compactIconColor.display.visible",value:!1}}],layoutDefaults:{m:{position:"center",panelHeight:50/375,logoMaxHeight:30/375,logoPosition:"center",compactLogoPosition:"left",navTextPosition:"center",navTextOffset:0,compactNavTextPosition:"center",compactNavTextOffset:0,showIcon:"on",iconSize:30/375,textWidth:240/375,openPanelSize:100,navTextWidth:120/375,gap:24/375,navGap:24/375,navPaddingLeft:20/375,navPaddingRight:20/375,textPaddingLeft:10/375,textPaddingRight:10/375,textPaddingTop:10/375,textPaddingBottom:10/375,fontSize:16/375,lineHeight:20/375,letterSpacing:0,wordSpacing:0,textAppearance:ei,openFontSize:34/375,openLineHeight:20/375,openLetterSpacing:0,openWordSpacing:0,openTextAppearance:ei,openTextAlign:"center",compactPanelHeight:40/375,compactLogoMaxHeight:20/375,compactShowIcon:"on",compactIconSize:16/375,compactNavTextWidth:80/375,compactNavGap:24/375,compactNavPaddingLeft:20/375,compactNavPaddingRight:20/375,compactFontSize:16/375,compactLineHeight:20/375,compactLetterSpacing:0,compactWordSpacing:0,compactTextAppearance:ei},t:{textAlign:"center",position:"center",panelHeight:60/768,logoMaxHeight:30/768,logoPosition:"left",compactLogoPosition:"left",navTextPosition:"center",navTextOffset:0,compactNavTextPosition:"center",compactNavTextOffset:0,showIcon:"on",iconSize:16/768,textWidth:300/768,openPanelSize:100,navTextWidth:90/768,gap:32/768,navGap:32/768,navPaddingLeft:20/768,navPaddingRight:20/768,textPaddingLeft:10/768,textPaddingRight:10/768,textPaddingTop:10/768,textPaddingBottom:10/768,fontSize:18/768,lineHeight:20/768,letterSpacing:0,wordSpacing:0,textAppearance:ei,openFontSize:75/768,openLineHeight:20/768,openLetterSpacing:0,openWordSpacing:0,openTextAppearance:ei,openTextAlign:"center",compactTextAlign:"center",compactPanelHeight:40/768,compactLogoMaxHeight:20/768,compactShowIcon:"on",compactIconSize:16/768,compactNavTextWidth:80/768,compactNavGap:32/768,compactNavPaddingLeft:20/768,compactNavPaddingRight:20/768,compactFontSize:16/768,compactLineHeight:20/768,compactLetterSpacing:0,compactWordSpacing:0,compactTextAppearance:ei},d:{position:"center",panelHeight:50/1440,logoMaxHeight:30/1440,logoPosition:"left",compactLogoPosition:"left",navTextPosition:"center",navTextOffset:0,compactNavTextPosition:"center",compactNavTextOffset:0,showIcon:"on",iconSize:20/1440,textWidth:300/1440,openPanelSize:100,navTextWidth:60/1440,gap:12/1440,navGap:64/1440,navPaddingLeft:10/1440,navPaddingRight:10/1440,textPaddingLeft:10/1440,textPaddingRight:10/1440,textPaddingTop:10/1440,textPaddingBottom:10/1440,fontSize:16/1440,lineHeight:16/1440,letterSpacing:0,wordSpacing:0,textAppearance:ei,textAlign:"center",openFontSize:90/1440,openLineHeight:16/1440,openLetterSpacing:0,openWordSpacing:0,openTextAppearance:ei,openTextAlign:"center",compactPanelHeight:30/1440,compactLogoMaxHeight:20/1440,compactShowIcon:"on",compactIconSize:20/1440,compactNavTextWidth:60/1440,compactNavGap:20/1440,compactNavPaddingLeft:10/1440,compactNavPaddingRight:10/1440,compactFontSize:16/1440,compactLineHeight:16/1440,compactLetterSpacing:0,compactWordSpacing:0,compactTextAppearance:ei,compactTextAlign:"center"}},layout:["__componentName__","link","logo","logoMaxHeight","logoPosition","panelHeight","backgroundColor","logoColor","iconColor","showIcon","iconSize","linkColor","openLinkColor","compactShowIcon","compactIconColor","compactLinkColor","compactLogoColor","compactBackgroundColor","compactLogoMaxHeight","compactLogoPosition","compactPanelHeight","compactIconSize","compactNavTextWidth","compactNavTextPosition","compactNavTextOffset","compactNavGap","compactNavPaddingLeft","compactNavPaddingRight","compactFontFamily","compactFontSettings","compactFontSize","compactLineHeight","compactLetterSpacing","compactWordSpacing","compactTextAlign","compactTextAppearance","openLogoColor","menuBackgroundColor","overlayColor","closeButtonColor","effect","textWidth","navTextWidth","navTextPosition","navTextOffset","position","gap","navGap","navPaddingLeft","navPaddingRight","textPaddingLeft","textPaddingRight","textPaddingTop","textPaddingBottom","fontFamily","fontSettings","fontSize","lineHeight","letterSpacing","wordSpacing","textAlign","textAppearance","openFontFamily","openFontSettings","openFontSize","openLineHeight","openLetterSpacing","openWordSpacing","openTextAlign","openTextAppearance"]},panels:[{id:"general",icon:"settings",title:"General",tooltip:"General Settings",layout:["__componentName__","logo"]},{id:"default",icon:"default",title:"Default",tooltip:"Default State",layout:uC},{id:"compact",icon:"compact",title:"Compact",tooltip:"Compact State",layout:pC,availableWhen:{navigationPosition:["switch"]}},{id:"open",icon:"open",title:"Open",tooltip:"Open State",layout:mC},{id:"links",icon:"content",title:"Links",tooltip:"Link Settings",layout:["__componentName__","link"]}],paletteBookmark:{items:[...hC],panelIds:["default","compact","open"],stateItems:{default:["iconColor","logoColor","linkColor","backgroundColor"],hover:["iconColor","logoColor","linkColor"],compact:["compactIconColor","compactLogoColor","compactLinkColor","compactBackgroundColor"],"compact-hover":["compactIconColor","compactLogoColor","compactLinkColor"],open:["closeButtonColor","openLogoColor","openLinkColor","menuBackgroundColor","overlayColor"],"open-hover":["closeButtonColor","openLogoColor","openLinkColor"]}},states:["default","hover"],statePanels:["default","compact","open"]},yC={element:aC,id:"basic-burger",name:"Basic Burger",category:"navigation",version:1,preview:{type:"image",url:"https://cdn.cntrl.site/component-assets/Simple Burger.png"},layoutMode:"navigation",defaultSize:{d:{width:"100%",height:60/1440},t:{width:"100%",height:60/768},m:{width:"100%",height:56/375}},defaultNavigationPosition:{d:"switch",t:"switch",m:"stickyTop"},schema:fC,sourceCode:sC,assetsPaths:{content:[],parameters:[{path:"logo.icon",placeholderEnabled:!0}]},fontSettingsPaths:{content:[],parameters:[{path:"fontFamily"},{path:"openFontFamily"},{path:"compactFontFamily"}]},fontRelations:{fontSettings:"fontFamily",openFontSettings:"openFontFamily",compactFontSettings:"compactFontFamily"}},Od=120,Dd=3,vC=.12,Kl={x:0,y:0,width:100,height:100};function $o(e,t){return e.map(n=>n.map(i=>({x:(i.x-t.x)/t.width,y:(i.y-t.y)/t.height})))}function La(e){return e<0?0:e>1?1:e}function zd(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 xC(e,t){let n=1/0,i=1/0,o=-1/0,r=-1/0;for(const d of e)for(const u of d){const p=u.x*t.width,y=u.y*t.height;p<n&&(n=p),p>o&&(o=p),y<i&&(i=y),y>r&&(r=y)}const l=o-n,c=r-i;return!isFinite(l)||!isFinite(c)||l<=0||c<=0?null:{x:n,y:i,width:l,height:c}}function bC(e){return e.map(([t,n])=>({x:t,y:n}))}function Es(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 SC(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=La(n[o]),l=La(n[o+1]);l>r&&i.push({x0:r,x1:l})}return wC(i)}function wC(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 $C(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 CC(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 TC(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 IC(e,t,n,i){let o=null;for(let r=0;r<Dd;r+=1){const l=La(t+(n-t)*r/Math.max(1,Dd-1)),c=SC(e,l),d=i==="avoid"?CC(c):c;if(o=o===null?d:$C(o,d),o.length===0)return[]}return o??[]}function Bd(e,t="stretch",n=Kl){const i=e.trim();if(!i)return null;if(/^[Mm]/.test(i)){const l=ki(i),c=$r(l);if(c.length)return t==="viewbox"?$o(c,n):Es(c);if(typeof document>"u")return null;const d=i.split(/(?=[Mm])/).map(y=>y.trim()).filter(Boolean),u=document.createElementNS("http://www.w3.org/2000/svg","svg"),p=[];for(const y of d){const S=document.createElementNS("http://www.w3.org/2000/svg","path");S.setAttribute("d",y),u.appendChild(S);let m=0;try{m=S.getTotalLength()}catch{m=0}if(!m)continue;const h=[];for(let x=0;x<Od;x+=1){const w=S.getPointAtLength(x/Od*m);h.push({x:w.x,y:w.y})}p.push(h)}return p.length?t==="viewbox"?$o(p,n):Es(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"?$o([r],n):Es([r])}const Yl={bobbin:"M57.63,0 L57.63,37.24 L74.66,37.24 L74.66,56.07 L57.63,100 L33.84,100 L16.81,56.07 L16.81,37.24 L33.84,37.24 L33.84,0 Z",circle:"M50,0 C77.61,0 100,22.39 100,50 C100,77.61 77.61,100 50,100 C22.39,100 0,77.61 0,50 C0,22.39 22.39,0 50,0 Z",shield:"M0,0 L100,0 L100,50 L50,100 L0,50 Z",vase:"M25.37,0 L91.55,0 C91.55,0 74.8,25.14 83.07,50.03 C91.34,74.92 74.61,100 74.61,100 L8.43,100 C8.43,100 32.3,75.08 23.9,50 C15.5,24.92 25.37,0 25.37,0 Z",parallelogram:"M25.37,0 L91.55,0 L74.61,100 L8.43,100 Z",diamond:"M50,0 L80,50 L50,100 L20,50 Z"},Js="0 0 100 100",Pa=100,el=16,LC=12,PC=16,Rs=/([MmZzLlHhVvCcSsQqTtAa])([^MmZzLlHhVvCcSsQqTtAa]*)/g,MC=/[+-]?(?:\d*\.\d+|\d+\.?)(?:[eE][+-]?\d+)?/g,jd=Math.PI/4,EC=8,RC=Math.PI/18,kC=8,fo=24,yo=[];function AC(){return[{closed:!0,nodes:[{p:{x:0,y:0},in:null,out:null},{p:{x:1,y:0},in:null,out:null},{p:{x:1,y:1},in:null,out:null},{p:{x:0,y:1},in:null,out:null}]}]}function ks(e,t){return un(e,n=>({x:(n.x-t.x)/t.width,y:(n.y-t.y)/t.height}))}function FC(e){const t=Li(e),n=t.maxX-t.minX,i=t.maxY-t.minY;return!isFinite(n)||!isFinite(i)||n<=0||i<=0?e:un(e,o=>({x:(o.x-t.minX)/n,y:(o.y-t.minY)/i}))}function NC(e,t){if(!(t.width>0)||!(t.height>0))return e;const n=Math.min(t.width,t.height),i=(t.width-n)/2,o=(t.height-n)/2;return un(e,r=>({x:(i+r.x*n)/t.width,y:(o+r.y*n)/t.height}))}function Vd(e,t,n,i,o,r){let l=[];if(t&&t.length)l=ks(t,i);else{const c=e.trim();if(c&&/^[Mm]/.test(c)){const d=ki(c);d.length&&(l=n==="viewbox"?ks(d,i):FC(d))}if(!l.length){const d=o!=="custom"?Yl[o]:void 0;d?l=ks(ki(d),Kl):l=AC()}}return o==="circle"?NC(l,r):l}function Gd(e,t){return!(t.width>0)||!(t.height>0)||!e.length?"":Ho(un(e,n=>({x:n.x*t.width,y:n.y*t.height})))}function tl(e){const t=e==="rectangle"||e==="custom"?void 0:Yl[e];return t?$o($r(ki(t)),Kl):[bC([[0,0],[1,0],[1,1],[0,1]])]}function _C(e){const t=e.match(MC);return t?t.map(Number).filter(n=>!Number.isNaN(n)):[]}function Ln(e,t,n){return{x:e.x+(t.x-e.x)*n,y:e.y+(t.y-e.y)*n}}function nl(e,t){return{x:t.x*2-e.x,y:t.y*2-e.y}}function gn(e){return{x:e.x,y:e.y}}function HC(e){return{p:gn(e.p),in:e.in?gn(e.in):null,out:e.out?gn(e.out):null}}function Vn(e){return e.map(t=>({closed:t.closed,nodes:t.nodes.map(HC)}))}function un(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 Xd(e,t,n,i=n){return un(e,o=>({x:t.x+(o.x-t.x)*n,y:t.y+(o.y-t.y)*i}))}function WC(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:gn(e),c2:gn(l),p:gn(l)}];const u=i*Math.PI/180,p=Math.cos(u),y=Math.sin(u),S=(e.x-l.x)/2,m=(e.y-l.y)/2,h=p*S+y*m,x=-y*S+p*m,w=h*h/(c*c)+x*x/(d*d);if(w>1){const U=Math.sqrt(w);c*=U,d*=U}const F=o===r?-1:1,v=c*c*x*x+d*d*h*h,P=Math.max(0,c*c*d*d-v),M=v===0?0:F*Math.sqrt(P/v),K=M*c*x/d,X=-M*d*h/c,j=p*K-y*X+(e.x+l.x)/2,N=y*K+p*X+(e.y+l.y)/2,_=Math.atan2((x-X)/d,(h-K)/c);let L=Math.atan2((-x-X)/d,(-h-K)/c)-_;!r&&L>0&&(L-=Math.PI*2),r&&L<0&&(L+=Math.PI*2);const Y=Math.max(1,Math.ceil(Math.abs(L)/(Math.PI/2))),R=L/Y,I=4/3*Math.tan(R/4),$=(U,E)=>({x:j+p*c*U-y*d*E,y:N+y*c*U+p*d*E}),G=[];let O=_;for(let U=0;U<Y;U+=1){const E=O+R,f=Math.cos(O),Q=Math.sin(O),q=Math.cos(E),pe=Math.sin(E);G.push({c1:$(f-I*Q,Q+I*f),c2:$(q+I*pe,pe-I*q),p:U===Y-1?gn(l):$(q,pe)}),O=E}return G}function ki(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 m=i[0],h=i[i.length-1];Math.abs(m.p.x-h.p.x)<1e-6&&Math.abs(m.p.y-h.p.y)<1e-6&&(m.in=h.in??m.in,i.pop())}i.length>1&&n.push({nodes:i,closed:o}),i=[],o=!1},p=(m,h)=>{i.push({p:m,in:Un(h??null,m),out:null}),r=m},y=m=>{if(!i.length)return;const h=i[i.length-1];h.out=Un(m,h.p)};Rs.lastIndex=0;let S=Rs.exec(t);for(;S!==null;){const m=S[1],h=m.toUpperCase(),x=m!==h,w=_C(S[2]),F=v=>x?{x:r.x+w[v],y:r.y+w[v+1]}:{x:w[v],y:w[v+1]};if(h==="Z")o=!0,u(),r=gn(l),c=null,d=null;else if(h==="M"){for(let v=0;v+1<w.length;v+=2){const P=F(v);v===0&&(u(),l=gn(P)),p(P)}c=null,d=null}else if(h==="L"){for(let v=0;v+1<w.length;v+=2)p(F(v));c=null,d=null}else if(h==="H"){for(const v of w)p({x:x?r.x+v:v,y:r.y});c=null,d=null}else if(h==="V"){for(const v of w)p({x:r.x,y:x?r.y+v:v});c=null,d=null}else if(h==="C"){for(let v=0;v+5<w.length;v+=6){const P=F(v),M=F(v+2),K=F(v+4);y(P),p(K,M),c=M}d=null}else if(h==="S"){for(let v=0;v+3<w.length;v+=4){const P=c?nl(c,r):gn(r),M=F(v),K=F(v+2);y(P),p(K,M),c=M}d=null}else if(h==="Q")for(let v=0;v+3<w.length;v+=4){const P=F(v),M=F(v+2);y(Ln(r,P,2/3)),p(M,Ln(M,P,2/3)),d=P,c=null}else if(h==="T")for(let v=0;v+1<w.length;v+=2){const P=d?nl(d,r):gn(r),M=F(v);y(Ln(r,P,2/3)),p(M,Ln(M,P,2/3)),d=P,c=null}else if(h==="A")for(let v=0;v+6<w.length;v+=7){const P=x?{x:r.x+w[v+5],y:r.y+w[v+6]}:{x:w[v+5],y:w[v+6]};for(const M of WC(r,w[v],w[v+1],w[v+2],w[v+3]!==0,w[v+4]!==0,P))y(M.c1),p(M.p,M.c2);c=null,d=null}S=Rs.exec(t)}return u(),n}function Bn(e){return`${Number(e.toFixed(2))}`}function Un(e,t){return!e||Math.abs(e.x-t.x)<1e-6&&Math.abs(e.y-t.y)<1e-6?null:e}function jp(e){return!!(Un(e.in,e.p)||Un(e.out,e.p))}function Vo(e,t){return!Un(e.out,e.p)&&!Un(t.in,t.p)}function Ud(e,t){if(Vo(e,t))return`L${Bn(t.p.x)},${Bn(t.p.y)}`;const n=Un(e.out,e.p)??e.p,i=Un(t.in,t.p)??t.p;return`C${Bn(n.x)},${Bn(n.y)} ${Bn(i.x)},${Bn(i.y)} ${Bn(t.p.x)},${Bn(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${Bn(i.p.x)},${Bn(i.p.y)}`);let r=i;for(const l of o)t.push(Ud(r,l)),r=l;if(n.closed){const l=Ud(r,i);l.charAt(0)==="C"&&t.push(l),t.push("Z")}}return t.join(" ")}function Vp(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 il(e,t,n){if(Vo(e,t))return Ln(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 $r(e){const t=[];for(const n of e){if(n.nodes.length<2)continue;const i=[];for(const o of Vp(n)){if(Vo(o.from,o.to)){i.push(gn(o.from.p));continue}for(let r=0;r<el;r+=1)i.push(il(o.from,o.to,r/el))}n.closed||i.push(gn(n.nodes[n.nodes.length-1].p)),i.length>2&&t.push(i)}return t}function Li(e){let t=1/0,n=1/0,i=-1/0,o=-1/0;for(const r of $r(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 OC(e){const t=Li(e);return!isFinite(t.minX)||!isFinite(t.maxX)||!isFinite(t.minY)||!isFinite(t.maxY)?null:{x:(t.minX+t.maxX)/2,y:(t.minY+t.maxY)/2}}function Gp(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 Xp(e){return e.filter(t=>t.length>2).map(t=>{if(t.length<=LC)return{closed:!0,nodes:t.map(r=>({p:gn(r),in:null,out:null}))};const n=Math.max(1,Math.round(t.length/PC)),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:gn(r),...Gp(i[(l-1+o)%o],r,i[(l+1)%o])}))}})}function Up(e,t,n=1){if(!e.length)return!1;const i=Li(e);if(!isFinite(i.minX)||!isFinite(i.maxX))return!1;const o=i.maxX-i.minX,r=i.maxY-i.minY;if(o<=t.width*2.5&&r<=t.height*2.5)return!1;const l=Math.max(n,t.width*.5),c=Math.max(n,t.height*.5);return i.minX<t.x-l||i.minY<t.y-c||i.maxX>t.x+t.width+l||i.maxY>t.y+t.height+c}function DC(e,t,n,i,o,r,l){const c=t.width>0?n.width/t.width:1,d=t.height>0?n.height/t.height:1;return!(r>0)||!(l>0)||!(c>0)||!(d>0)?e:un(e,u=>{const p=i+(u.x-t.x)*r,y=o+(u.y-t.y)*l;return{x:t.x+p/c,y:t.y+y/d}})}function zC(e,t){if(!e.length)return e;const n=Li(e),i=n.maxX-n.minX,o=n.maxY-n.minY;if(!(i>0)||!(o>0)||n.minX>=t.x-1e-6&&n.minY>=t.y-1e-6&&n.maxX<=t.x+t.width+1e-6&&n.maxY<=t.y+t.height+1e-6)return e;const l=Math.min(t.width/i,t.height/o),c=t.x+(t.width-i*l)/2,d=t.y+(t.height-o*l)/2;return un(e,u=>({x:c+(u.x-n.minX)*l,y:d+(u.y-n.minY)*l}))}function qp(e){const t={x:0,y:0,width:Pa,height:Pa},n=e!=="custom"?Yl[e]:void 0,i=n?un(ki(n),r=>({x:r.x/100*t.width+t.x,y:r.y/100*t.height+t.y})):un(Xp(tl("rectangle")),r=>({x:r.x*t.width+t.x,y:r.y*t.height+t.y})),o=zC(i,t);return{shape:e,customPath:Ho(o),pathFit:"viewbox",pathViewBox:Js}}function ta(e,t){return t>0?Math.round(e/t)*t:e}function BC(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=Vn(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 qd(e,t,n,i){var r;if(!t.length)return e;const o=Vn(e);for(const{contour:l,node:c}of t){const d=(r=o[l])==null?void 0:r.nodes[c];d&&(d.p={x:d.p.x+n,y:d.p.y+i},d.in&&(d.in={x:d.in.x+n,y:d.in.y+i}),d.out&&(d.out={x:d.out.x+n,y:d.out.y+i}))}return o}function jC(e,t){const n=new Map;for(const{contour:o,node:r}of t){const l=n.get(o)??[];l.push(r),n.set(o,l)}let i=e;return n.forEach((o,r)=>{const l=[...o].sort((c,d)=>d-c);for(const c of l)i=Kp(i,r,c)}),i}function VC(e,t,n,i,o,r){var u;if(!((u=e[t])==null?void 0:u.nodes[n]))return e;const c=Vn(e),d=c[t].nodes[n];if(d[i]=gn(o),r){const p=i==="in"?"out":"in";d[p]=nl(o,d.p)}return c}function GC(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=Vn(e);return r[t].nodes[n][i]=null,r}function XC(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=Vn(e),d=c[t].nodes,u=n+1;if(Vo(r,l))return d.splice(u,0,{p:Ln(r.p,l.p,i),in:null,out:null}),{contours:c,nodeIndex:u};const p=r.out??r.p,y=l.in??l.p,S=Ln(r.p,p,i),m=Ln(p,y,i),h=Ln(y,l.p,i),x=Ln(S,m,i),w=Ln(m,h,i),F=Ln(x,w,i),v=(n+1)%o.nodes.length;return d[n].out=S,d[v].in=h,d.splice(u,0,{p:F,in:x,out:w}),{contours:c,nodeIndex:u}}function Kp(e,t,n){const i=e[t];if(!i||i.nodes.length<=3)return e;const o=Vn(e);return o[t].nodes.splice(n,1),o}function Kd(e,t,n){const i=e[t];if(!(i==null?void 0:i.nodes[n]))return e;const r=Vn(e),l=r[t].nodes,c=l[n],d=l.length,u=(n-1+d)%d,p=(n+1)%d,y=!!Un(l[u].out,l[u].p),S=!!Un(l[p].in,l[p].p);if(jp(c)||y||S)return c.in=null,c.out=null,l[u].out=null,l[p].in=null,r;const m=Gp(l[u].p,c.p,l[p].p);return c.in=m.in,c.out=m.out,r}function UC(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),point:c}}function Yd(e,t){let n=null;return e.forEach((i,o)=>{for(const r of Vp(i)){const l=Vo(r.from,r.to)?1:el;for(let c=0;c<l;c+=1){const d=c/l,u=(c+1)/l,p=UC(t,il(r.from,r.to,d),il(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,point:p.point})}}}),n}function qC(e,t){const n=[];return e.forEach((i,o)=>{i.nodes.forEach((r,l)=>{o===t.contour&&l===t.node||n.push(r.p)})}),n}function Qd(e,t,n){const i=t.filter((r,l)=>isFinite(r)&&t.findIndex(c=>Math.abs(c-r)<1e-6)===l),o=i.map(r=>({value:r,axis:r,from:null}));for(const r of e)o.push({value:r[n],axis:null,from:r});for(const r of i)for(const l of e)o.push({value:r*2-l[n],axis:r,from:l});return o}function Zd(e,t,n,i,o){const r=i(t)[n];let l=null,c=1/0;for(const d of e){const u=n==="x"?{x:d.value,y:t.y}:{x:t.x,y:d.value},p=Math.abs(i(u)[n]-r);p>o||l&&p>=c||(l=d,c=p)}return l}function KC(e,t){return e.length===t.length&&e.every((n,i)=>n.kind===t[i].kind&&n.a.x===t[i].a.x&&n.a.y===t[i].a.y&&n.b.x===t[i].b.x&&n.b.y===t[i].b.y)}function YC(e){const t=Math.PI*2;return((e+Math.PI)%t+t)%t-Math.PI}function ol(e,t){const n=t.x-e.x,i=t.y-e.y,o=Math.hypot(n,i);return o<1e-6?null:{x:n/o,y:i/o}}function QC(e,t){const n=ol(e,t);return n?{kind:"align",a:{x:e.x-n.x*fo,y:e.y-n.y*fo},b:{x:t.x+n.x*fo,y:t.y+n.y*fo}}:{kind:"align",a:e,b:t}}function rl(e,t,n){return t==="x"?{kind:"center",a:{x:e,y:0},b:{x:e,y:n.height}}:{kind:"center",a:{x:0,y:e},b:{x:n.width,y:e}}}function Jd(e,t,n,i,o){if(e.axis===null)return QC(n,o(e.from??n));const r=t==="x"?{x:e.axis,y:0}:{x:0,y:e.axis};return rl(o(r)[t],t,i)}function ZC(e,t,n,i,o){const r=[],l=o(e);return t&&e.x===t.value&&r.push(Jd(t,"x",l,i,o)),n&&e.y===n.value&&r.push(Jd(n,"y",l,i,o)),r}function JC(e,t,n,i){const o=e==null?void 0:e.nodes[t];if(!e||!o)return null;const r=i(o.p),l=n==="in"?o.out:o.in;if(l)return ol(i(l),r);const c=e.nodes.length,d=t+(n==="in"?1:-1);if(!e.closed&&(d<0||d>=c))return null;const u=e.nodes[(d+c)%c];if(!u)return null;const p=(n==="in"?u.in:u.out)??u.p;return ol(i(p),r)}function eT(e,t,n,i,o,r,l){const c=r(t),d=r(e),u=d.x-c.x,p=d.y-c.y,y=Math.hypot(u,p);if(y<1e-6)return{point:e,guides:yo};const S=Math.atan2(p,u),m=Math.round(S/jd)*jd;let h=o?m:null,x=!1;if(!o){const X=[];n&&X.push({angle:Math.atan2(n.y,n.x),smooth:!0}),X.push({angle:m,smooth:!1});for(const j of X){const N=YC(j.angle-S);if(!(Math.abs(N)>RC)&&!(Math.abs(Math.sin(N))*y>EC)){h=j.angle,x=j.smooth;break}}}const w=i!==null&&i>0&&Math.abs(y-i)<=kC;if(h===null&&!w)return{point:e,guides:yo};const F=h??S,v=w?i:y,P={x:Math.cos(F),y:Math.sin(F)},M=v+(h===null?0:fo),K=w?v:x?fo:0;return{point:l({x:c.x+P.x*v,y:c.y+P.y*v}),guides:[{kind:"angle",a:{x:c.x-P.x*K,y:c.y-P.y*K},b:{x:c.x+P.x*M,y:c.y+P.y*M}}]}}const al=.1,sl=8,tT=4,eu=10,Ma=(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}}},Yp=e=>{switch(e){case"nw":return"se";case"ne":return"sw";case"se":return"nw";case"sw":return"ne"}},ll=(e,t)=>{const n=Ma(e,t),i=t==="nw"||t==="sw"?-1:1,o=t==="nw"||t==="ne"?-1:1;return{x:n.x+i*eu,y:n.y+o*eu}},cl=(e,t)=>!(t.width>0)||!(t.height>0)||!(e.width>0)||!(e.height>0)?1:Math.max(e.width/t.width,e.height/t.height),Ui=(e,t,n)=>{const i=cl(e,t)*n;return{width:t.width*i,height:t.height*i}},jn=(e,t,n)=>(e-t)*n,vo=(e,t,n,i)=>{const o=e-t;if(Math.abs(o)<1e-6)return .5;const r=n/o;return(i==null?void 0:i.clamp)===!1?r:Math.abs(o)<tT?.5:La(r)},nT=(e,t,n,i,o,r)=>{const l=Ui(e,n,r),c=e.x+jn(e.width,l.width,i),d=e.y+jn(e.height,l.height,o),u=cl(e,n),p=cl(t,n),y=Math.min(sl,Math.max(al,p>0?r*(u/p):r)),S=Ui(t,n,y);return{focalX:vo(t.width,S.width,c-t.x,{clamp:!1}),focalY:vo(t.height,S.height,d-t.y,{clamp:!1}),scale:y}},iT=6,oT=3,rT=2,As="",aT=new RegExp("\\p{L}","gu"),tu=20,sT={arb:"ar",azj:"az",bel:"be",bos:"bs",bul:"bg",ces:"cs",deu:"de",eng:"en",fas:"fa",fra:"fr",hau:"ha",hin:"hi",hrv:"hr",hun:"hu",ibo:"ig",ind:"id",ita:"it",jav:"jv",kaz:"kk",kin:"rw",lin:"ln",mar:"mr",nep:"ne",nld:"nl",nya:"ny",pol:"pl",por:"pt",ron:"ro",run:"rn",rus:"ru",som:"so",spa:"es",srp:"sr",sun:"su",swe:"sv",swh:"sw",tgl:"tl",tur:"tr",ukr:"uk",urd:"ur",uzn:"uz",vie:"vi",yor:"yo",zlm:"ms",zul:"zu"},dl={be:()=>Promise.resolve().then(()=>require("./index-B1vNL0m-.js")).then(e=>e.index),bg:()=>Promise.resolve().then(()=>require("./index-kFrlcZxC.js")).then(e=>e.index),cs:()=>Promise.resolve().then(()=>require("./index-B6E31HBG.js")).then(e=>e.index),de:()=>Promise.resolve().then(()=>require("./index-CNFsG2yO.js")).then(e=>e.index),en:()=>Promise.resolve().then(()=>require("./index-x_p4zv7D.js")).then(e=>e.index),"en-gb":()=>Promise.resolve().then(()=>require("./index-BkmSPu6z.js")).then(e=>e.index),es:()=>Promise.resolve().then(()=>require("./index-CADju5Cy.js")).then(e=>e.index),fr:()=>Promise.resolve().then(()=>require("./index-Rwqfce2n.js")).then(e=>e.index),hi:()=>Promise.resolve().then(()=>require("./index-HhE2sJlU.js")).then(e=>e.index),hr:()=>Promise.resolve().then(()=>require("./index-DapMA5nM.js")).then(e=>e.index),hu:()=>Promise.resolve().then(()=>require("./index-kjKI70JX.js")).then(e=>e.index),id:()=>Promise.resolve().then(()=>require("./index-BlAuAthm.js")).then(e=>e.index),it:()=>Promise.resolve().then(()=>require("./index-BK-G0i5L.js")).then(e=>e.index),mr:()=>Promise.resolve().then(()=>require("./index-CIgabTwE.js")).then(e=>e.index),nl:()=>Promise.resolve().then(()=>require("./index-BrL2zv3x.js")).then(e=>e.index),pl:()=>Promise.resolve().then(()=>require("./index-DehKWXGA.js")).then(e=>e.index),pt:()=>Promise.resolve().then(()=>require("./index-C0cxTf5o.js")).then(e=>e.index),ro:()=>Promise.resolve().then(()=>require("./index-CJ0NMfJ3.js")).then(e=>e.index),ru:()=>Promise.resolve().then(()=>require("./index-gBhj9Tcu.js")).then(e=>e.index),sr:()=>Promise.resolve().then(()=>require("./index-1HMblVmZ.js")).then(e=>e.index),sv:()=>Promise.resolve().then(()=>require("./index-CDO1-R3j.js")).then(e=>e.index),tr:()=>Promise.resolve().then(()=>require("./index-CG_43X7q.js")).then(e=>e.index),uk:()=>Promise.resolve().then(()=>require("./index-Ypt3vHbi.js")).then(e=>e.index)},lT=(e,t)=>{const n=e;return t(n)??t(n.default)??null};let nu=null;const cT=()=>(nu??(nu=Promise.resolve().then(()=>require("./index-2JTNRDR1.js")).then(e=>e.franc).catch(()=>null)),nu),iu=new Map,dT=e=>{let t=iu.get(e);return t||(t=dl[e]().then(n=>lT(n,i=>i==null?void 0:i.hyphenateSync)).catch(()=>null),iu.set(e,t)),t},ou=e=>{if(!e)return null;const t=e.toLowerCase();if(dl[t])return t;const n=t.split("-")[0];return dl[n]?n:null},uT=(e,t)=>{const n=t.trim();if(n.length<tu)return;const i=e(n,{minLength:tu});if(i!=="und")return sT[i]??i},pT={hyphenateSync:null};function mT(e,t){const[n,i]=s.useState(null);return s.useEffect(()=>{if(!e)return;let o=!1;return cT().then(async r=>{const l=r?uT(r,t):void 0,c=typeof document<"u"?document.documentElement.lang:"",d=ou(l)??ou(c)??"en",u=await dT(d);o||i({lang:l,hyphenateSync:u})}),()=>{o=!0}},[e,t]),e&&n?n:pT}const ru=e=>{var t;return((t=e.match(aT))==null?void 0:t.length)??0};function gT(e,t){if(e.length<2||e.includes(As))return;const n=new Set;if(t){const o=t(e,{hyphenChar:As,minWordLength:iT});let r=0;for(let l=0;l<o.length;l+=1)o[l]===As?n.add(r):r+=1}for(let o=1;o<e.length-1;o+=1)e[o-1]==="-"&&n.add(o);const i=[...n].filter(o=>{const r=e[o-1]==="-";return o>0&&o<e.length&&ru(e.slice(0,o))>=(r?1:oT)&&ru(e.slice(o))>=(r?1:rT)}).sort((o,r)=>o-r);return i.length?i:void 0}const au=1.08,na=14,ia=8;function hT({P:e,box:t,bounds:n,natural:i,imageUrl:o,maskPath:r,stage:l,onStageChange:c,focalX:d,focalY:u,scale:p,onChange:y,onCommit:S}){const m=s.useRef(null),h=`pretext-image-ghost-${s.useId().replace(/:/g,"")}`,x=s.useRef(null),w=s.useRef(null),F=s.useRef({focalX:d,focalY:u,scale:p});F.current={focalX:d,focalY:u,scale:p};const v=l==="image";s.useEffect(()=>{var R;v&&((R=m.current)==null||R.focus({preventScroll:!0}))},[v]);const P=s.useCallback((R,I)=>{var G;const $=(G=m.current)==null?void 0:G.getBoundingClientRect();return!$||$.width<=0||$.height<=0?{x:0,y:0}:{x:(R-$.left)/$.width*t.width,y:(I-$.top)/$.height*t.height}},[t.width,t.height]),M=R=>{var $,G;if(!i)return;R.stopPropagation(),R.preventDefault(),($=m.current)==null||$.focus({preventScroll:!0});const I=Ui(n,i,p);x.current={pointerId:R.pointerId,origin:P(R.clientX,R.clientY),startX:jn(n.width,I.width,d),startY:jn(n.height,I.height,u),width:I.width,height:I.height,moved:!1},(G=m.current)==null||G.setPointerCapture(R.pointerId)},K=(R,I)=>{var q,pe;if(!i)return;R.stopPropagation(),R.preventDefault(),(q=m.current)==null||q.focus({preventScroll:!0});const $=Ui(n,i,p),G=jn(n.width,$.width,d),O=jn(n.height,$.height,u),U={minX:G,minY:O,maxX:G+$.width,maxY:O+$.height},E=Ma(U,Yp(I)),f=Ma(U,I),Q=Math.hypot(f.x-E.x,f.y-E.y);!isFinite(Q)||Q<=0||(w.current={pointerId:R.pointerId,anchor:E,startDistance:Q,startScale:p,startX:G,startY:O,moved:!1},(pe=m.current)==null||pe.setPointerCapture(R.pointerId))},X=R=>{if(!i)return;const I=w.current;if(I&&R.pointerId===I.pointerId){R.stopPropagation(),R.preventDefault();const G=P(R.clientX,R.clientY),O={x:G.x-n.x,y:G.y-n.y},U=Math.hypot(O.x-I.anchor.x,O.y-I.anchor.y),E=Math.min(sl,Math.max(al,I.startScale*(U/I.startDistance)));if(!I.moved&&Math.abs(E-I.startScale)<1e-4)return;I.moved=!0;const f=E/I.startScale,Q=I.anchor.x+(I.startX-I.anchor.x)*f,q=I.anchor.y+(I.startY-I.anchor.y)*f,pe=Ui(n,i,E);y({focalX:vo(n.width,pe.width,Q),focalY:vo(n.height,pe.height,q),scale:E});return}const $=x.current;if($&&R.pointerId===$.pointerId){R.stopPropagation(),R.preventDefault();const G=P(R.clientX,R.clientY),O=G.x-$.origin.x,U=G.y-$.origin.y;if(!$.moved&&O===0&&U===0)return;$.moved=!0,y({focalX:vo(n.width,$.width,$.startX+O),focalY:vo(n.height,$.height,$.startY+U),scale:p})}},j=R=>{var G,O;const I=x.current;if(I&&R.pointerId===I.pointerId){x.current=null,R.stopPropagation(),(G=m.current)!=null&&G.hasPointerCapture(I.pointerId)&&m.current.releasePointerCapture(I.pointerId),I.moved&&S(F.current);return}const $=w.current;$&&R.pointerId===$.pointerId&&(w.current=null,R.stopPropagation(),(O=m.current)!=null&&O.hasPointerCapture($.pointerId)&&m.current.releasePointerCapture($.pointerId),$.moved&&S(F.current))},N=R=>{if(R.key==="Escape"){R.stopPropagation(),c("none");return}if(R.key==="="||R.key==="+"||R.key==="-"||R.key==="_"){R.preventDefault(),R.stopPropagation();const I=R.key==="="||R.key==="+",$=Math.min(sl,Math.max(al,p*(I?au:1/au))),G={focalX:d,focalY:u,scale:$};y(G),S(G)}},_=["nw","ne","se","sw"],T={minX:n.x,minY:n.y,maxX:n.x+n.width,maxY:n.y+n.height},L=s.useMemo(()=>{const R=i??{width:n.width,height:n.height},I=Ui(n,R,p);return!(I.width>0)||!(I.height>0)?null:{x:n.x+jn(n.width,I.width,d),y:n.y+jn(n.height,I.height,u),width:I.width,height:I.height}},[i,n.x,n.y,n.width,n.height,d,u,p]),Y=L?{minX:L.x,minY:L.y,maxX:L.x+L.width,maxY:L.y+L.height}:T;return a.jsxs("svg",{ref:m,className:`${e}-editor${v?` ${e}-editor-armed`:""}`,width:t.width,height:t.height,viewBox:`0 0 ${t.width} ${t.height}`,tabIndex:0,onKeyDown:N,onPointerMove:X,onPointerUp:j,onPointerCancel:j,onLostPointerCapture:j,"data-pretext-image-editor":!0,children:[a.jsx("rect",{className:`${e}-editor-surface`,width:t.width,height:t.height,onPointerDown:()=>c("none")}),v&&o&&L&&r&&a.jsxs(a.Fragment,{children:[a.jsx("defs",{children:a.jsxs("mask",{id:h,maskUnits:"userSpaceOnUse",x:L.x,y:L.y,width:L.width,height:L.height,children:[a.jsx("rect",{x:L.x,y:L.y,width:L.width,height:L.height,fill:"#FFFFFF"}),a.jsx("path",{d:r,fillRule:"evenodd",fill:"#000000"})]})}),a.jsx("image",{className:`${e}-editor-ghost`,href:o??void 0,x:L.x,y:L.y,width:L.width,height:L.height,preserveAspectRatio:"none",mask:`url(#${h})`}),a.jsx("rect",{className:`${e}-editor-image-bounds`,x:L.x,y:L.y,width:L.width,height:L.height})]}),v&&a.jsxs(a.Fragment,{children:[a.jsx("rect",{className:`${e}-editor-bbox`,x:n.x,y:n.y,width:n.width,height:n.height}),a.jsx("rect",{className:`${e}-editor-body`,x:n.x,y:n.y,width:n.width,height:n.height,onPointerDown:M}),_.map(R=>{const I=ll(Y,R),$=R==="ne"||R==="sw";return a.jsxs("g",{children:[a.jsx("rect",{className:`${e}-editor-scale`,x:I.x-ia/2,y:I.y-ia/2,width:ia,height:ia}),a.jsx("rect",{className:`${e}-editor-scale-grab${$?` ${e}-editor-scale-grab-nesw`:""}`,x:I.x-na/2,y:I.y-na/2,width:na,height:na,onPointerDown:G=>K(G,R)})]},R)})]})]})}const ul=10,fT=ul*2,zn=7,yT=4,lo=9,vT=3.5,su=1.08,xT=.05,oa=14,bT=1,ra=14,aa=8;function ST({P:e,box:t,viewBox:n,contours:i,snap:o,stretchToBox:r,uniformStretch:l=!1,stage:c,onStageChange:d,onSelectionChange:u,onChange:p,onCommit:y}){const S=s.useRef(null),m=s.useRef(null),h=s.useRef(i);h.current=i;const x=s.useRef(null),w=s.useRef(null),F=s.useRef(null),v=s.useRef(null),[P,M]=s.useState([]),[K,X]=s.useState(yo),[j,N]=s.useState(null),_=s.useCallback(g=>{X(Z=>KC(Z,g)?Z:g)},[]),T=c==="shape";s.useEffect(()=>{var g;T&&((g=S.current)==null||g.focus({preventScroll:!0}))},[T]),s.useEffect(()=>{T||M(g=>g.length?[]:g)},[T]);const L=P.length>0;s.useEffect(()=>{u==null||u(L)},[L,u]),s.useEffect(()=>()=>u==null?void 0:u(!1),[u]);const Y=n.width>0?t.width/n.width:1,R=n.height>0?t.height/n.height:1,I=Math.min(Y,R),$=r&&l?I:Y,G=r&&l?I:R,O=r&&l?(t.width-n.width*I)/2:0,U=r&&l?(t.height-n.height*I)/2:0,E=s.useCallback(g=>r?{x:O+(g.x-n.x)*$,y:U+(g.y-n.y)*G}:{x:g.x-n.x,y:g.y-n.y},[r,n,$,G,O,U]),f=s.useCallback(g=>r?{x:n.x+($>0?(g.x-O)/$:0),y:n.y+(G>0?(g.y-U)/G:0)}:{x:n.x+g.x,y:n.y+g.y},[r,n,$,G,O,U]),Q=s.useMemo(()=>f({x:t.width/2,y:t.height/2}),[f,t.width,t.height]),q=s.useCallback((g,Z)=>{var re;const J=(re=S.current)==null?void 0:re.getBoundingClientRect();if(!J||J.width<=0||J.height<=0)return{x:0,y:0};if(r){const he=(g-J.left)/J.width*t.width,z=(Z-J.top)/J.height*t.height;return{x:n.x+($>0?(he-O)/$:0),y:n.y+(G>0?(z-U)/G:0)}}return{x:n.x+(g-J.left),y:n.y+(Z-J.top)}},[r,n,t.width,t.height,$,G,O,U]),pe=s.useCallback((g,Z)=>{var re;const J=(re=S.current)==null?void 0:re.getBoundingClientRect();return!J||J.width<=0||J.height<=0?{x:0,y:0}:{x:(g-J.left)/J.width*t.width,y:(Z-J.top)/J.height*t.height}},[t.width,t.height]),k=s.useCallback((g,Z)=>{const J=l&&!(Z!=null&&Z.preserveShape)?DC(g,n,t,O,U,$,G):g;y(J,Z)},[y,l,n,t,O,U,$,G]),me=s.useCallback(()=>{N(null)},[]),C=s.useCallback((g,Z,J)=>{if(!J||x.current||w.current||F.current||v.current){me();return}const re=pe(g,Z),he=un(h.current,E);for(const H of he)for(const be of H.nodes)if(Math.hypot(be.p.x-re.x,be.p.y-re.y)<=lo){me();return}const z=Yd(he,re);if(!z||z.distance>ul){me();return}const B=he[z.contour],ne=B==null?void 0:B.nodes[z.segment],ce=B==null?void 0:B.nodes[(z.segment+1)%((B==null?void 0:B.nodes.length)??1)],ee=!!(ne&&ce&&!Vo(ne,ce));N(H=>H&&H.curved===ee&&Math.hypot(H.point.x-z.point.x,H.point.y-z.point.y)<.25?H:{point:z.point,curved:ee})},[pe,E,me]),ue=g=>{var ze;const Z=g.metaKey||g.ctrlKey,J=F.current;if(J&&g.pointerId===J.pointerId){if(g.stopPropagation(),g.preventDefault(),J.startDistance<=0)return;const Xe=q(g.clientX,g.clientY),Ue=Math.hypot(Xe.x-J.origin.x,Xe.y-J.origin.y),Qe=Math.max(xT,Ue/J.startDistance);if(!J.moved&&Math.abs(Qe-1)<1e-4)return;J.moved=!0,p(Xd(J.startContours,J.origin,Qe));return}const re=w.current;if(re&&g.pointerId===re.pointerId){g.stopPropagation(),g.preventDefault();const Xe=q(g.clientX,g.clientY),{bbox:Ue}=re,Qe=Ue.maxX-Ue.minX,We=Ue.maxY-Ue.minY,it=Xe.x-re.origin.x,ye=Xe.y-re.origin.y;let Te=it,Ve=ye;if(isFinite(Qe)&&isFinite(We))if(r){let et=n.x,at=n.x+n.width,tt=n.y,Ye=n.y+n.height;l&&($>0&&(et=n.x+(0-O)/$,at=n.x+(t.width-O)/$),G>0&&(tt=n.y+(0-U)/G,Ye=n.y+(t.height-U)/G));const xt=Math.min(et,at-Qe),pt=Math.max(et,at-Qe),De=Math.min(tt,Ye-We),_e=Math.max(tt,Ye-We),He=Math.min(pt,Math.max(xt,Ue.minX+it)),Ae=Math.min(_e,Math.max(De,Ue.minY+ye));Te=He-Ue.minX,Ve=Ae-Ue.minY}else{const et=Ue.minX-n.x,at=Ue.minY-n.y,tt=Math.min(0,t.width-Qe),Ye=Math.max(0,t.width-Qe),xt=Math.min(0,t.height-We),pt=Math.max(0,t.height-We),De=Math.min(Ye,Math.max(tt,et+it)),_e=Math.min(pt,Math.max(xt,at+ye));Te=De-et,Ve=_e-at}const Ze=[];if(!Z&&isFinite(Qe)&&isFinite(We)){const et=E({x:Ue.minX+Qe/2+Te,y:Ue.minY+We/2+Ve}),at={x:t.width/2,y:t.height/2};Math.abs(et.x-at.x)<=oa&&(Te=Q.x-Ue.minX-Qe/2,Ze.push(rl(at.x,"x",t))),Math.abs(et.y-at.y)<=oa&&(Ve=Q.y-Ue.minY-We/2,Ze.push(rl(at.y,"y",t)))}if(!re.moved&&Te===0&&Ve===0)return;re.moved=!0,_(Ze.length?Ze:yo),p(un(re.startContours,et=>({x:et.x+Te,y:et.y+Ve})),{carryImage:!0});return}const he=v.current;if(he&&g.pointerId===he.pointerId){g.stopPropagation(),g.preventDefault();const Xe=q(g.clientX,g.clientY);let Ue=Xe.x-he.origin.x,Qe=Xe.y-he.origin.y;if(g.shiftKey&&(Math.abs(Ue)>Math.abs(Qe)?Qe=0:Ue=0),!he.moved&&Ue===0&&Qe===0)return;he.moved=!0,p(qd(he.startContours,he.selection,Ue,Qe));return}const z=x.current;if(!z||g.pointerId!==z.pointerId){C(g.clientX,g.clientY,P.length>0||T);return}me(),g.stopPropagation(),g.preventDefault();const B=q(g.clientX,g.clientY);if(z.kind==="anchor"){const Xe={x:z.anchor.x+(B.x-z.origin.x),y:z.anchor.y+(B.y-z.origin.y)},Ue=Z?[]:qC(h.current,{contour:z.contour,node:z.node}),Qe=Z||!z.center?[]:[z.center],We=Zd(Qd(Ue,Qe.map(Te=>Te.x),"x"),Xe,"x",E,oa),it=Zd(Qd(Ue,Qe.map(Te=>Te.y),"y"),Xe,"y",E,oa),ye=Z?Xe:{x:(We==null?void 0:We.value)??ta(Xe.x,o),y:(it==null?void 0:it.value)??ta(Xe.y,o)};if(g.shiftKey&&(Math.abs(ye.x-z.anchor.x)>Math.abs(ye.y-z.anchor.y)?ye.y=z.anchor.y:ye.x=z.anchor.x),!z.moved&&ye.x===z.anchor.x&&ye.y===z.anchor.y)return;z.moved=!0,_(ZC(ye,We,it,t,E)),p(BC(h.current,z.contour,z.node,ye));return}const ne=(ze=h.current[z.contour])==null?void 0:ze.nodes[z.node],ce=z.mirror&&!g.altKey,ee=ce||Z?null:z.kind==="in"?ne==null?void 0:ne.out:ne==null?void 0:ne.in,H=ne?E(ne.p):null,be=ee?E(ee):null,ae=ne&&(!Z||g.shiftKey)?eT(B,ne.p,ce||Z?null:JC(h.current[z.contour],z.node,z.kind,E),H&&be?Math.hypot(be.x-H.x,be.y-H.y):null,g.shiftKey,E,f):{point:B,guides:yo},W=ae.guides.length?ae.point:Z?B:{x:ta(B.x,o),y:ta(B.y,o)},ke=z.kind==="in"?ne==null?void 0:ne.in:ne==null?void 0:ne.out;!z.moved&&ke&&W.x===ke.x&&W.y===ke.y||(z.moved=!0,_(ae.guides),p(VC(h.current,z.contour,z.node,z.kind,W,ce)))},te=g=>{_(yo);const Z=F.current;if(Z&&g.pointerId===Z.pointerId){F.current=null,g.stopPropagation();const ee=S.current;ee!=null&&ee.hasPointerCapture(Z.pointerId)&&ee.releasePointerCapture(Z.pointerId),Z.moved&&k(h.current,{preserveShape:!0});return}const J=w.current;if(J&&g.pointerId===J.pointerId){w.current=null,g.stopPropagation();const ee=S.current;ee!=null&&ee.hasPointerCapture(J.pointerId)&&ee.releasePointerCapture(J.pointerId),J.moved?k(h.current,{preserveShape:!0}):M([]);return}const re=v.current;if(re&&g.pointerId===re.pointerId){v.current=null,g.stopPropagation();const ee=S.current;ee!=null&&ee.hasPointerCapture(re.pointerId)&&ee.releasePointerCapture(re.pointerId),re.moved&&k(h.current);return}const he=x.current;if(!he||g.pointerId!==he.pointerId)return;x.current=null,g.stopPropagation();const z=S.current;z!=null&&z.hasPointerCapture(he.pointerId)&&z.releasePointerCapture(he.pointerId);const B=Math.hypot(g.clientX-he.clientOrigin.x,g.clientY-he.clientOrigin.y);if(he.moved||B>yT){he.moved&&k(h.current);return}if(!he.toggleOnRelease||g.type!=="pointerup")return;const ce=Kd(h.current,he.contour,he.node);ce!==h.current&&(p(ce),k(ce))},fe=g=>{g.stopPropagation()},Pe=g=>{var Z,J;g.stopPropagation(),g.preventDefault(),me(),(Z=S.current)==null||Z.focus({preventScroll:!0}),w.current={pointerId:g.pointerId,origin:q(g.clientX,g.clientY),startContours:Vn(i),bbox:Li(i),moved:!1},(J=S.current)==null||J.setPointerCapture(g.pointerId)},de=(g,Z)=>{var B,ne;g.stopPropagation(),g.preventDefault(),me(),(B=S.current)==null||B.focus({preventScroll:!0}),M([]),d("shape");const J=Li(i),re=Ma(J,Yp(Z)),he=ll(J,Z),z=Math.hypot(he.x-re.x,he.y-re.y);!isFinite(z)||z<=0||(F.current={pointerId:g.pointerId,corner:Z,origin:re,startDistance:z,startContours:Vn(i),moved:!1},(ne=S.current)==null||ne.setPointerCapture(g.pointerId))},we=(g,Z,J,re)=>{var B,ne,ce,ee;g.stopPropagation(),g.preventDefault(),me(),(B=S.current)==null||B.focus({preventScroll:!0});const he=(ne=i[J])==null?void 0:ne.nodes[re];if(!he)return;if(g.altKey){const H=Z==="anchor"?Kp(i,J,re):GC(i,J,re,Z);if(H===i)return;M(Z==="anchor"?[]:[{contour:J,node:re}]),p(H),k(H);return}const z=g.metaKey||g.ctrlKey;if(Z==="anchor"&&g.shiftKey&&!z){M(H=>H.some(be=>be.contour===J&&be.node===re)?H.filter(be=>!(be.contour===J&&be.node===re)):[...H,{contour:J,node:re}]);return}if(Z==="anchor"&&!z&&P.length>1&&P.some(H=>H.contour===J&&H.node===re)){v.current={pointerId:g.pointerId,origin:q(g.clientX,g.clientY),startContours:Vn(i),selection:P,moved:!1},(ce=S.current)==null||ce.setPointerCapture(g.pointerId);return}M([{contour:J,node:re}]),x.current={kind:Z,contour:J,node:re,pointerId:g.pointerId,origin:q(g.clientX,g.clientY),clientOrigin:{x:g.clientX,y:g.clientY},anchor:he.p,center:OC(i),mirror:Z!=="anchor"&&!!(he.in&&he.out),toggleOnRelease:z,moved:!1},(ee=S.current)==null||ee.setPointerCapture(g.pointerId)},V=g=>{g.stopPropagation(),g.preventDefault(),me();const Z=un(i,E),J=Yd(Z,pe(g.clientX,g.clientY));if(!J||J.distance>ul)return;const{contours:re,nodeIndex:he}=XC(i,J.contour,J.segment,J.t);he<0||(M([{contour:J.contour,node:he}]),p(re),k(re))},ie=g=>{if(g.key==="="||g.key==="+"||g.key==="-"||g.key==="_"){g.preventDefault(),g.stopPropagation();const z=Li(i);if(!isFinite(z.minX)||!isFinite(z.maxX))return;const B={x:(z.minX+z.maxX)/2,y:(z.minY+z.maxY)/2},ce=g.key==="="||g.key==="+"?su:1/su,ee=Xd(i,B,ce);p(ee),k(ee,{preserveShape:!0});return}if(g.key==="Escape"){g.stopPropagation(),M([]),d("none");return}if(!P.length)return;if(g.key==="Backspace"||g.key==="Delete"){g.preventDefault(),g.stopPropagation();const z=jC(i,P);if(z===i)return;M([]),p(z),k(z);return}const Z=o>0?o:bT,J=g.shiftKey?Z*10:Z,re={ArrowLeft:[-J,0],ArrowRight:[J,0],ArrowUp:[0,-J],ArrowDown:[0,J]}[g.key];if(!re)return;g.preventDefault(),g.stopPropagation();const he=qd(i,P,re[0],re[1]);p(he),k(he)},oe=s.useMemo(()=>Ho(un(i,E)),[i,E]),le=s.useMemo(()=>Li(i),[i]),ve=E({x:le.minX,y:le.minY}),Fe={width:E({x:le.maxX,y:le.minY}).x-ve.x,height:E({x:le.minX,y:le.maxY}).y-ve.y},Ee=T&&P.length===0&&isFinite(le.minX)&&isFinite(le.maxX)&&le.maxX>le.minX&&le.maxY>le.minY,Ce=P.length>0||T,Se=Ce;return a.jsxs("svg",{ref:S,className:`${e}-editor${Ce?` ${e}-editor-armed`:""}`,width:t.width,height:t.height,viewBox:`0 0 ${t.width} ${t.height}`,tabIndex:0,onKeyDown:ie,onPointerDown:()=>{var g;return(g=S.current)==null?void 0:g.focus({preventScroll:!0})},onPointerMove:ue,onPointerLeave:me,onPointerUp:te,onPointerCancel:te,onLostPointerCapture:te,onContextMenu:g=>{g.preventDefault()},"data-pretext-path-editor":!0,"data-selection":"none",children:[a.jsx("rect",{className:`${e}-editor-surface`,width:t.width,height:t.height,onPointerDown:()=>{M([]),d("none")},onClick:V}),Se&&a.jsx("path",{className:`${e}-editor-outline`,d:oe}),Se&&K.map((g,Z)=>a.jsx("line",{className:`${e}-editor-snap ${e}-editor-snap-${g.kind}`,x1:g.a.x,y1:g.a.y,x2:g.b.x,y2:g.b.y},`${g.kind}-${Z}`)),a.jsx("path",{ref:m,className:`${e}-editor-body`,d:oe,fillRule:"evenodd",onPointerDown:Pe,onClick:V}),Se&&a.jsx("path",{className:`${e}-editor-hit`,d:oe,style:{strokeWidth:fT},onClick:V}),Se&&j&&a.jsx("rect",{className:`${e}-editor-add-preview`,x:j.point.x-zn/2,y:j.point.y-zn/2,width:zn,height:zn,rx:j.curved?zn/2:0}),Se&&i.map((g,Z)=>g.nodes.map((J,re)=>{const he=P.some(B=>B.contour===Z&&B.node===re),z=E(J.p);return a.jsxs("g",{children:[he&&P.length===1&&["in","out"].map(B=>{const ne=J[B];if(!ne)return null;const ce=E(ne);return a.jsxs("g",{children:[a.jsx("line",{className:`${e}-editor-handle-line`,x1:z.x,y1:z.y,x2:ce.x,y2:ce.y}),a.jsx("circle",{className:`${e}-editor-handle`,cx:ce.x,cy:ce.y,r:vT}),a.jsx("circle",{className:`${e}-editor-grab`,cx:ce.x,cy:ce.y,r:lo,onPointerDown:ee=>we(ee,B,Z,re),onClick:fe})]},B)}),a.jsx("rect",{className:`${e}-editor-anchor${he?` ${e}-editor-anchor-selected`:""}`,x:z.x-zn/2,y:z.y-zn/2,width:zn,height:zn,rx:jp(J)?zn/2:0}),a.jsx("rect",{className:`${e}-editor-grab`,x:z.x-lo,y:z.y-lo,width:lo*2,height:lo*2,onPointerDown:B=>we(B,"anchor",Z,re),onClick:fe,onDoubleClick:B=>{B.stopPropagation(),B.preventDefault();const ne=Kd(i,Z,re);p(ne),k(ne)}})]},`${Z}-${re}`)})),Ee&&a.jsxs("g",{children:[a.jsx("rect",{className:`${e}-editor-bbox`,x:ve.x,y:ve.y,width:Fe.width,height:Fe.height}),["nw","ne","se","sw"].map(g=>{const Z=E(ll(le,g)),J=g==="ne"||g==="sw";return a.jsxs("g",{children:[a.jsx("rect",{className:`${e}-editor-scale`,x:Z.x-aa/2,y:Z.y-aa/2,width:aa,height:aa}),a.jsx("rect",{className:`${e}-editor-scale-grab${J?` ${e}-editor-scale-grab-nesw`:""}`,x:Z.x-ra/2,y:Z.y-ra/2,width:ra,height:ra,onPointerDown:re=>de(re,g),onClick:fe})]},g)})]})]})}const wT=4e3,$T=/^(?:https?:|mailto:|tel:)/i;function Qp(e){return!!e&&typeof e=="object"&&e.type==="link"}function CT(e){if(!e)return;const t=e.replace(/\s+/g,"");if(!(/^[a-z][a-z0-9+.-]*:/i.test(t)&&!$T.test(t)))return t}function TT(e){const t=[];return e.forEach((n,i)=>{const o=(r,l,c)=>{for(const d of r){if(Qp(d)){o(d.children??[],CT(d.value),d.target);continue}const u=d,p=(u==null?void 0:u.text)??"";if(p.trim())for(const y of p.split(/\s+/))y&&t.push({text:y,leaf:u,href:l,target:c,para:i})}};o((n==null?void 0:n.children)??[])}),t}function lu(e){return{...e.fontFamily&&{fontFamily:zo(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 IT(e){return e.map(t=>{const n=[],i=o=>{for(const r of o){if(Qp(r)){i(r.children??[]);continue}n.push((r==null?void 0:r.text)??"")}};return i((t==null?void 0:t.children)??[]),n.join("")})}function LT(e,t,n,i,o){if(t<=0||!e.length||n<=0||i<=0)return e;const r=o==="avoid"?1:-1;return e.map(l=>{if(!l.length)return l;let c=1/0,d=-1/0,u=1/0,p=-1/0;for(const m of l){const h=m.x*n,x=m.y*i;h<c&&(c=h),h>d&&(d=h),x<u&&(u=x),x>p&&(p=x)}const y=(c+d)/2,S=(u+p)/2;return l.map(m=>{const h=m.x*n,x=m.y*i,w=h-y,F=x-S,v=Math.sqrt(w*w+F*F);if(v<1e-6)return m;const M=Math.max(0,v+r*t)/v;return{x:(y+w*M)/n,y:(S+F*M)/i}})})}const PT=.75;function cu(e,t,n,i,o,r){if(e.kind==="fragment"||!t)return null;const l=e.token.text,c=e.offset>0?t[e.offset-1]:0,d=n?n.map(u=>u-e.offset).filter(u=>u>=(e.offset>0?2:1)&&u<l.length):Array.from({length:l.length-1},(u,p)=>p+1);for(let u=d.length-1;u>=0;u-=1){const p=d[u];if(e.offset+p>t.length)continue;const y=!!n&&l[p-1]!=="-",S=t[e.offset+p-1]-c,m=S+(y?r:0);if(!(m*o>i))return{chars:p,fragmentText:y?`${l.slice(0,p)}-`:l.slice(0,p),remainderText:l.slice(p),fragmentWidth:m,remainderWidth:Math.max(0,e.width-S)}}return null}function du(e){const{tokens:t,widths:n,rings:i,mode:o,align:r,scale:l,width:c,height:d,allowOverflow:u,capInset:p,capLines:y}=e,S=!!e.hyphenate,m=e.charWidths??[],h=e.hyphenPoints??[],x=e.hyphenWidth??0,w=e.lineHeight*l,F=e.spaceWidth*l,v=Math.max(0,e.shapeMargin??0),P=[],M=t.map((E,f)=>({token:E,originalIndex:f,width:n[f],kind:"whole",offset:0}));if(!M.length||c<=0||w<=0)return{segments:P,placed:0,height:0,capLeft:0,capTop:0,renderTokens:t};const K=Math.max(1,F*.5),X=w*vC,j=LT(i,v,c,d,o),N=Math.max(1,Math.floor(e.columns??1)),_=N>1?Math.max(0,e.columnGap??0):0,T=(c-_*(N-1))/N;let L=0,Y=0,R=0,I=0,$=0,G=null;const O=(E,f,Q)=>IC(j,(E+X)/d,(E+w-X)/d,o).map(q=>({x0:Math.max(f,q.x0*c),x1:Math.min(Q,q.x1*c)})).filter(q=>q.x1>q.x0);for(let E=0;E<N&&L<M.length&&T>0;E+=1){const f=E*(T+_),Q=f+T,q=u&&E===N-1;let pe=0;for(let C=0;C+w<=d;C+=w)for(const ue of O(C,f,Q))pe=Math.max(pe,ue.x1-ue.x0);let k=M[L].token.para,me=0;for(;L<M.length&&R<wT;){const C=me+w>d;if(C&&!q)break;const ue=M[L].token.para;if(ue>k+1){me+=w*(ue-k-1),k=ue-1,R+=1;continue}let te=C?[{x0:f,x1:Q}]:O(me,f,Q);p>0&&y>0&&E===0&&!C&&te.length&&(G===null&&(G=R,I=te[0].x0,$=me),R-G<y&&(te=TC(te,{x0:I,x1:I+p})));const fe=te.reduce((Pe,de)=>Math.max(Pe,de.x1-de.x0),0);for(const Pe of te){const de=Pe.x1-Pe.x0;if(de<K)continue;if(L>=M.length||M[L].token.para!==ue)break;const we=L;let V=0;for(;L<M.length&&M[L].token.para===ue;){const ie=M[L],oe=L===we,le=ie.width*l,ve=oe?le:F+le;if(V+ve<=de){V+=ve,L+=1;continue}const Fe=de-V-(oe?0:F),Ee=oe&&le>T-.5,Ce=de>=fe-.5&&de>=pe*PT,Se=m[ie.originalIndex],g=h[ie.originalIndex],Z=(S&&g?cu(ie,Se,g,Fe,l,x):null)??(Ee&&Ce?cu(ie,Se,void 0,Fe,l,x):null);if(Z){const J={token:{...ie.token,text:Z.fragmentText},originalIndex:ie.originalIndex,width:Z.fragmentWidth,kind:"fragment",offset:ie.offset},re={token:{...ie.token,text:Z.remainderText},originalIndex:ie.originalIndex,width:Z.remainderWidth,kind:"remainder",offset:ie.offset+Z.chars};M.splice(L,1,J,re),V+=(oe?0:F)+Z.fragmentWidth*l,L+=1;break}if(Ee&&N===1&&de>=pe-.5){V+=ve,L+=1;continue}break}if(L>we){const ie=L>=M.length||M[L].token.para!==ue;P.push({top:me,left:Pe.x0,width:de,from:we,to:L,justify:r==="justify"&&!ie})}if(L>=M.length||M[L].token.para!==ue)break}k=ue,me+=w,R+=1}Y=Math.max(Y,me)}let U=0;if(L>0){const E=M[L-1];U=E.kind==="fragment"?E.originalIndex:E.originalIndex+1}return{segments:P,placed:U,height:P.length?Y:0,capLeft:I,capTop:$,renderTokens:M.map(E=>E.token)}}const MT=.12,ET=2,RT=10,Fs=.25,kT=e=>{const t=e.getBoundingClientRect();return{top:t.top,left:t.left,width:t.width,height:t.height}},AT=(e,t)=>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,FT=(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=kT(e);(!r||!AT(r,c))&&(r=c,i(c)),o=requestAnimationFrame(l)};return l(),()=>cancelAnimationFrame(o)},[e,t]),n},Ns=(e,t)=>{if(!(t.width>0)||!(t.height>0))return e;const n=Math.min(t.width,t.height),i=(t.width-n)/2,o=(t.height-n)/2;return e.map(r=>r.map(l=>({x:(i+l.x*n)/t.width,y:(o+l.y*n)/t.height})))},nr=typeof window>"u"?s.useEffect:s.useLayoutEffect;function NT(){return typeof document>"u"?null:document.body}function _T({P:e,item:t,shape:n,customPath:i,pathFit:o,viewBox:r,mode:l,align:c,allowOverflow:d,fitEnabled:u,scale:p,onFitScale:y,padding:S,columns:m,gutter:h,hyphenate:x,showOverflowIndicator:w,dropCapLines:F,dropCapSize:v,showGuides:P,typography:M,imageUrl:K,imageFocalX:X,imageFocalY:j,imageScale:N,imageCustomPath:_,imagePathEdited:T,pathDragActive:L,pathCarryImage:Y,onCarryImageConsumed:R,pathEditor:I,imageEditor:$}){var Gt,Zt;const G=`pretext-shape-image-${s.useId().replace(/:/g,"")}`,[O,U]=s.useState(null),E=s.useRef(null),[f,Q]=s.useState({width:0,height:0}),[q,pe]=s.useState(0),[k,me]=s.useState(0),[C,ue]=s.useState(null),[te,fe]=s.useState(0),[Pe,de]=s.useState("none");s.useEffect(()=>{!I&&!$&&de("none")},[I,$]);const[we,V]=s.useState(null);s.useEffect(()=>{if(!K||typeof Image>"u"){V(null);return}let $e=!1;const Ge=new Image;return Ge.onload=()=>{$e||V({width:Ge.naturalWidth,height:Ge.naturalHeight})},Ge.src=K,()=>{$e=!0}},[K]);const ie=s.useMemo(()=>Array.isArray(t==null?void 0:t.text)?t.text:[],[t]),oe=s.useMemo(()=>TT(ie),[ie]),le=s.useMemo(()=>IT(ie),[ie]),ve=s.useMemo(()=>le.join(`
|
|
27903
|
-
`),[le]),{lang:Fe,hyphenateSync:Ee}=mT(x,ve),Ce=s.useMemo(()=>x?oe.map($e=>gT($e.text,Ee)):[],[x,oe,Ee]),Se=F>0&&v>1?((Zt=(Gt=oe[0])==null?void 0:Gt.text)==null?void 0:Zt.charAt(0))??"":"",g=(I==null?void 0:I.contours)??null,Z=s.useMemo(()=>{let $e=[];if(g){const Ge=$r(g);Ge.length&&($e=$o(Ge,r))}if(!$e.length){const Ge=i.trim(),ft=Ge?Bd(Ge,o,r):null;ft&&ft.length?$e=ft:$e=tl(n==="custom"?"rectangle":n)}return n==="circle"?Ns($e,f):$e},[g,n,i,o,r,f.width,f.height]),J=I==null?void 0:I.onConvert,re=(I==null?void 0:I.needsConversion)??!1,he=s.useMemo(()=>{if(n==="circle")return!1;const $e=g??(i.trim()?ki(i):null);return!!($e&&Up($e,r))},[g,i,r,n]),[z,B]=s.useState(null);nr(()=>{if(!he){z&&B(null);return}!z&&f.width>0&&f.height>0&&B({width:f.width,height:f.height})},[he,f.width,f.height,z]);const ne=s.useMemo(()=>{if(!he||f.width<=0||f.height<=0)return Z;const $e=z??f,Ge=r.width/$e.width,ft=r.height/$e.height;return Z.map(Lt=>Lt.map(wt=>({x:wt.x*Ge,y:wt.y*ft})))},[Z,he,z,r.width,r.height,f.width,f.height]),ce=s.useMemo(()=>{if(g){const Lt=$r(g);if(Lt.length){const wt=$o(Lt,r);return n==="circle"?Ns(wt,f):wt}}const $e=_.trim(),Ge=$e?Bd($e,o,r):null,ft=Ge&&Ge.length?Ge:tl(n==="custom"?"rectangle":n);return n==="circle"?Ns(ft,f):ft},[g,n,_,o,r,f.width,f.height]),ee=s.useMemo(()=>{if(!he||f.width<=0||f.height<=0)return ce;const $e=z??f,Ge=r.width/$e.width,ft=r.height/$e.height;return ce.map(Lt=>Lt.map(wt=>({x:wt.x*Ge,y:wt.y*ft})))},[ce,he,z,r.width,r.height,f.width,f.height]),H=s.useRef(null),be=s.useRef(!1);s.useEffect(()=>{if(!(!J||f.width<=0||f.height<=0)){if(he){if(H.current===i)return;const $e=g??(i.trim()?ki(i):null);if(!($e!=null&&$e.length))return;const Ge=un($e,ft=>({x:r.x+(ft.x-r.x)/f.width*r.width,y:r.y+(ft.y-r.y)/f.height*r.height}));H.current=Ho(Ge),J(Ge);return}!re||!Z.length||be.current||(be.current=!0,J(un(Xp(Z),$e=>({x:$e.x*Pa,y:$e.y*Pa}))))}},[re,he,J,Z,g,i,r,f.width,f.height]);const ae=s.useCallback(()=>{const $e=O;if(!$e)return;const Ge=$e.getBoundingClientRect(),ft=window.getComputedStyle($e),Lt=parseFloat(ft.paddingTop)||0;pe(Nt=>Math.abs(Nt-Lt)<.5?Nt:Lt);const wt=parseFloat(ft.columnGap)||0;me(Nt=>Math.abs(Nt-wt)<.5?Nt:wt);const vt={width:Ge.width,height:Ge.height};Q(Nt=>Math.abs(Nt.width-vt.width)<.5&&Math.abs(Nt.height-vt.height)<.5?Nt:vt)},[O]);nr(()=>{const $e=O;if(!$e||typeof ResizeObserver>"u")return;ae();const Ge=new ResizeObserver(ae);return Ge.observe($e),()=>Ge.disconnect()},[O,ae]),nr(()=>{ae()},[S,h,ae]),s.useEffect(()=>{const $e=typeof document<"u"?document.fonts:void 0;$e!=null&&$e.ready&&$e.ready.then(()=>{fe(Ge=>Ge+1)})},[]),nr(()=>{const $e=E.current;if(!$e)return;if(!oe.length){ue(null);return}const Ge=[],ft=document.createDocumentFragment();for(const $t of oe){const _t=document.createElement("span");Object.assign(_t.style,lu($t.leaf)),_t.textContent=$t.text,ft.appendChild(_t),Ge.push(_t)}const Lt=document.createElement("span");Lt.textContent=" ",ft.appendChild(Lt);const wt=document.createElement("span");wt.textContent="-",ft.appendChild(wt);const vt=Se||"H",Nt=document.createElement("span");Nt.textContent=vt,Nt.style.lineHeight="1",ft.appendChild(Nt),$e.replaceChildren(ft);const Wt=window.getComputedStyle($e),Dt=parseFloat(Wt.fontSize)||16,Me=parseFloat(Wt.lineHeight),ct=Number.isNaN(Me)?Dt*1.2:Me,dt=Math.max(ct,Dt),kt=document.createElement("span");kt.textContent=vt,kt.style.lineHeight=`${dt}px`;const Ke=document.createElement("span");Ke.style.cssText="display:inline-block;width:0;height:0;vertical-align:baseline",kt.appendChild(Ke),$e.appendChild(kt);const st=kt.getBoundingClientRect().top,It=Ke.getBoundingClientRect().top,At=Math.max(1,It-st);kt.remove();let ut=At*.8;const Ut=document.createElement("canvas").getContext("2d"),Ot=$t=>`${Wt.fontStyle} ${Wt.fontWeight} ${$t}px ${Wt.fontFamily}`;if(Ut){Ut.font=Ot(Dt);const $t=Ut.measureText(vt).actualBoundingBoxAscent;$t>0&&(ut=$t)}const Bt=v>1?(v-1)*dt+ut:ut;let jt=Dt*(Bt/ut);if(Ut){Ut.font=Ot(jt);const $t=Ut.measureText(vt).actualBoundingBoxAscent;$t>0&&(jt=jt*(Bt/$t))}Nt.style.fontSize=`${jt}px`,Nt.style.lineHeight=`${jt}px`;const zt=document.createElement("span");zt.style.cssText="display:inline-block;width:0;height:0;vertical-align:baseline",Nt.appendChild(zt);const Kt=Math.max(1,zt.getBoundingClientRect().top-Nt.getBoundingClientRect().top);zt.remove();const Le=(v-1)*dt+At-Kt,Ne=Ge.map($t=>$t.getBoundingClientRect().width),Oe=Lt.getBoundingClientRect().width,yt=wt.getBoundingClientRect().width,Tt=Se?Nt.getBoundingClientRect().width:0,Je=(f.width-k*(m-1))/m,Pt=Ge.map(($t,_t)=>{var pi;const on=$t.firstChild;if(!(on instanceof Text)||on.data.length<2||!(Ne[_t]>Je-.5)&&!((pi=Ce[_t])!=null&&pi.length))return;const bn=document.createRange(),ui=$t.getBoundingClientRect().left,dn=[];for(let Yn=1;Yn<=on.data.length;Yn+=1)bn.setStart(on,0),bn.setEnd(on,Yn),dn.push(bn.getBoundingClientRect().right-ui);return dn});$e.replaceChildren(),ue({widths:Ne,spaceWidth:Oe,dashWidth:yt,charWidths:Pt,lineHeight:dt,capWidth:Tt,dropCapFontSize:jt,dropCapTopAdjust:Le})},[oe,M,Se,F,v,te,f.width,x,Ce,m,k]);const W=C&&Se?C.capWidth+C.lineHeight*MT:0,ke=Math.max(F,Math.ceil(v)),ze=s.useMemo(()=>{if(!C||!oe.length||f.width<=0||f.height<=0||!u)return 1;const $e=Lt=>du({tokens:oe,widths:C.widths,spaceWidth:C.spaceWidth,lineHeight:C.lineHeight,width:f.width,height:f.height,rings:ne,mode:l,align:c,scale:Lt,allowOverflow:!1,capInset:W*Lt,capLines:Se?ke:0,hyphenate:x,charWidths:C.charWidths,hyphenPoints:Ce,hyphenWidth:C.dashWidth,shapeMargin:q,columns:m,columnGap:k});if($e(1).placed>=oe.length)return 1;if($e(Fs).placed<oe.length)return Fs;let Ge=Fs,ft=1;for(let Lt=0;Lt<RT;Lt+=1){const wt=(Ge+ft)/2;$e(wt).placed>=oe.length?Ge=wt:ft=wt}return Ge},[C,oe,f.width,f.height,ne,l,c,u,W,Se,ke,x,Ce,q,m,k]);s.useEffect(()=>{y(ze)},[ze,y]);const Xe=u?Math.min(p,ze):1,Ue=s.useMemo(()=>!C||!oe.length||f.width<=0||f.height<=0?{segments:[],placed:0,height:0,capLeft:0,capTop:0,renderTokens:oe}:du({tokens:oe,widths:C.widths,spaceWidth:C.spaceWidth,lineHeight:C.lineHeight,width:f.width,height:f.height,rings:ne,mode:l,align:c,scale:Xe,allowOverflow:d,capInset:W*Xe,capLines:Se?ke:0,hyphenate:x,charWidths:C.charWidths,hyphenPoints:Ce,hyphenWidth:C.dashWidth,shapeMargin:q,columns:m,columnGap:k}),[C,oe,f.width,f.height,ne,l,c,Xe,d,W,Se,ke,x,Ce,q,m,k]),Qe=w&&oe.length>0&&Ue.placed<oe.length,We=C?C.dropCapFontSize*Xe:0,it=C?C.dropCapTopAdjust*Xe:0,ye=c==="justify"?"left":c,Te=C?C.lineHeight*Xe:0,Ve=Ue.segments.length?Ue.segments[Ue.segments.length-1]:null,Ze=Ve?{top:Ve.top+Te,left:Ve.left+Ve.width/2}:{top:f.height,left:f.width/2},et=!!(I&&g&&f.width>0&&f.height>0),at=!!$,tt=(et||at)&&f.width>0&&f.height>0,Ye=FT(O,tt),xt=tt&&Ye?NT():null,pt=s.useRef(!1),De=s.useCallback($e=>{pt.current=$e},[]);s.useEffect(()=>{if(!et&&!at)return;const $e=Ge=>{const ft=O;if(!ft)return;const Lt=ft.getBoundingClientRect();Ge.clientX>=Lt.left&&Ge.clientX<=Lt.right&&Ge.clientY>=Lt.top&&Ge.clientY<=Lt.bottom&&(Ge.preventDefault(),Ge.stopPropagation(),de(vt=>vt==="shape"&&pt.current?vt:vt==="shape"&&at?"image":et?"shape":"image"))};return document.addEventListener("dblclick",$e,!0),()=>document.removeEventListener("dblclick",$e,!0)},[et,at,O]);const _e=s.useMemo(()=>K&&f.width>0&&f.height>0?xC(ee,f):null,[K,ee,f.width,f.height]),He=s.useRef(null),Ae=(()=>{const $e=He.current;return Y||!T||!$||!we||!_e||!$e||_===$e.customPath||$e.shape!==n&&n!=="custom"?null:nT($e.bounds,_e,we,$e.focalX,$e.focalY,$e.scale)})();nr(()=>{if(!$){He.current=null;return}if(L||!we||!_e)return;const $e=He.current,Ge=!!($e&&_!==$e.customPath);Ge&&Ae&&$.onCommit(Ae),Ge&&Y&&(R==null||R()),He.current={rings:ee,bounds:_e,focalX:(Ae==null?void 0:Ae.focalX)??X,focalY:(Ae==null?void 0:Ae.focalY)??j,scale:(Ae==null?void 0:Ae.scale)??N,customPath:_,shape:n}},[L,Y,_,n,ee,_e,$,we,X,j,N,Ae,R]);const Be=He.current,Ie=!!(L&&!Y&&Be&&!Ae),mt=Ie&&Be?Be.focalX:(Ae==null?void 0:Ae.focalX)??X,ot=Ie&&Be?Be.focalY:(Ae==null?void 0:Ae.focalY)??j,Ct=Ie&&Be?Be.scale:(Ae==null?void 0:Ae.scale)??N,rt=Ie&&Be?Be.bounds:_e,St=s.useMemo(()=>{if(!(f.width>0)||!(f.height>0))return"";let $e=Vd(i,g,o,r,n,f);if(he){const Ge=z??f,ft=r.width/Ge.width,Lt=r.height/Ge.height;$e=un($e,wt=>({x:wt.x*ft,y:wt.y*Lt}))}return Gd($e,f)||zd(ne,f)},[i,g,o,r,n,f.width,f.height,he,z,ne]),nt=s.useMemo(()=>{if(!K||!(f.width>0)||!(f.height>0))return"";let $e=Vd(_,g,o,r,n,f);if(he){const Ge=z??f,ft=r.width/Ge.width,Lt=r.height/Ge.height;$e=un($e,wt=>({x:wt.x*ft,y:wt.y*Lt}))}return Gd($e,f)||zd(ee,f)},[K,_,g,o,r,n,f.width,f.height,he,z,ee]),Rt=`${G}-clip`,ht=s.useMemo(()=>{if(!rt)return null;const $e=we??{width:rt.width,height:rt.height},Ge=Ui(rt,$e,Ct);return{x:jn(rt.width,Ge.width,mt),y:jn(rt.height,Ge.height,ot),width:Ge.width,height:Ge.height}},[rt,we,mt,ot,Ct]);return a.jsxs("div",{className:`${e}-column`,style:{padding:S,columnGap:h},lang:Fe,ref:U,children:[St?a.jsxs("svg",{className:`${e}-shape-fill`,style:{top:0,left:0,width:f.width,height:f.height},viewBox:`0 0 ${f.width} ${f.height}`,preserveAspectRatio:"none","aria-hidden":!0,children:[a.jsx("path",{className:`${e}-shape-fill-path`,d:St,fillRule:"evenodd"}),K&&nt&&rt&&ht?a.jsxs(a.Fragment,{children:[a.jsx("defs",{children:a.jsx("clipPath",{id:Rt,clipPathUnits:"userSpaceOnUse",children:a.jsx("path",{d:nt,fillRule:"evenodd"})})}),a.jsx("image",{href:K,x:rt.x+ht.x,y:rt.y+ht.y,width:ht.width,height:ht.height,preserveAspectRatio:"none",clipPath:`url(#${Rt})`})]}):null]}):null,a.jsxs("div",{className:`${e}-flow${d?"":` ${e}-clip`}`,style:{...M,["--"+e+"-fit"]:Xe,top:0,left:0,width:f.width,height:f.height},children:[a.jsx("div",{className:`${e}-measure`,ref:E,style:M,"aria-hidden":!0}),Ue.segments.map(($e,Ge)=>{const ft=Ue.renderTokens.slice($e.from,$e.to),Lt=Ge===0;return a.jsx("div",{className:`${e}-line${$e.justify?` ${e}-line-justify`:""}`,"aria-hidden":!0,style:{top:`${$e.top}px`,left:`${$e.left}px`,width:`${$e.width}px`,textAlign:$e.justify?void 0:ye},children:ft.map((wt,vt)=>{const Wt=Se&&Lt&&$e.from===0&&vt===0?wt.text.slice(1):wt.text,Dt=lu(wt.leaf),Me=wt.href?a.jsx("a",{className:`${e}-link`,href:wt.href,target:wt.target,rel:wt.target?"noopener noreferrer":void 0,style:Dt,children:Wt}):a.jsx("span",{style:Dt,children:Wt});return a.jsxs("span",{children:[!$e.justify&&vt>0?" ":null,Me]},vt)})},`${$e.from}-${$e.to}-${Ge}`)}),P&&!g&&a.jsx("svg",{className:`${e}-guides`,viewBox:"0 0 1 1",preserveAspectRatio:"none","aria-hidden":!0,children:ne.map(($e,Ge)=>a.jsx("polygon",{points:$e.map(ft=>`${ft.x},${ft.y}`).join(" ")},Ge))})]}),Se&&C&&a.jsx("div",{className:`${e}-drop-cap`,"aria-hidden":!0,style:{...M,top:`${Ue.capTop+it}px`,left:`${Ue.capLeft}px`,fontSize:`${We}px`,lineHeight:`${We}px`},children:Se}),xt&&Ye&&(g&&I||$)&&qn.createPortal(a.jsxs("div",{"data-selection":"none",style:{position:"fixed",top:Ye.top,left:Ye.left,width:Ye.width,height:Ye.height,zIndex:ET,pointerEvents:"none"},children:[g&&I&&a.jsx(ST,{P:e,box:{width:Ye.width,height:Ye.height},viewBox:r,contours:g,snap:I.snap,stretchToBox:!he,uniformStretch:n==="circle",stage:Pe,onStageChange:de,onSelectionChange:De,onChange:I.onChange,onCommit:I.onCommit}),$&&rt&&a.jsx(hT,{P:e,box:{width:Ye.width,height:Ye.height},bounds:rt,natural:we,imageUrl:K,maskPath:nt,stage:Pe,onStageChange:de,focalX:mt,focalY:ot,scale:Ct,onChange:$.onChange,onCommit:$.onCommit})]}),xt),a.jsx("div",{className:`${e}-a11y`,children:le.map(($e,Ge)=>a.jsx("p",{children:$e},Ge))}),Qe&&a.jsxs("svg",{className:`${e}-overflow-icon`,width:"33",height:"24",viewBox:"0 0 33 24",style:{top:Ze.top,left:Ze.left},"aria-hidden":!0,children:[a.jsx("path",{d:"M12.8,4 L20.2,4 C24.68042,4 26.9206301,4 28.631924,4.87194781 C31.3123488,6.23769248 33,8.99168887 33,12 C33,15.0083111 31.3123488,17.7623075 28.631924,19.1280522 C26.9206301,20 24.68042,20 20.2,20 L12.8,20 C8.31957995,20 6.07936993,20 4.368076,19.1280522 C1.68765116,17.7623075 0,15.0083111 0,12 C0,8.99168887 1.68765116,6.23769248 4.368076,4.87194781 C6.07936993,4 8.31957995,4 12.8,4 Z",fill:"#FF4400"}),a.jsx("path",{transform:"translate(5, 0)",fill:"#FFFFFF",d:"M12,5.625 C12.3846269,5.625 12.7016304,5.91453014 12.7449542,6.28753416 L12.75,6.375 L12.75,11.25 L17.625,11.25 C18.0392136,11.25 18.375,11.5857864 18.375,12 C18.375,12.3846269 18.0854699,12.7016304 17.7124658,12.7449542 L17.625,12.75 L12.75,12.75 L12.75,17.625 C12.75,18.0392136 12.4142136,18.375 12,18.375 C11.6153731,18.375 11.2983696,18.0854699 11.2550458,17.7124658 L11.25,17.625 L11.25,12.75 L6.375,12.75 C5.96078644,12.75 5.625,12.4142136 5.625,12 C5.625,11.6153731 5.91453014,11.2983696 6.28753416,11.2550458 L6.375,11.25 L11.25,11.25 L11.25,6.375 C11.25,5.96078644 11.5857864,5.625 12,5.625 Z"})]})]})}const Zp=["diamond","parallelogram","vase","circle","shield","bobbin","custom"],HT={x:0,y:0,width:100,height:100},WT=e=>{const t=(e??"").trim().split(/[\s,]+/).map(Number).filter(n=>!Number.isNaN(n));return t.length<4||t[2]<=0||t[3]<=0?HT:{x:t[0],y:t[1],width:t[2],height:t[3]}},OT=e=>`
|
|
27898
|
+
`;function tr(e){return{type:"number",scope:"layout",title:e,min:0,max:100,display:{type:"range-control"}}}const ji={fontSettings:{type:"object",display:{type:"font-settings-weight",hideLabel:!0,useTabDesign:!0},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 bi(e,t){return e?`${e}${t.charAt(0).toUpperCase()}${t.slice(1)}`:t}function ql(e){return{[bi(e,"fontFamily")]:{type:"string",scope:"common",title:"",display:{type:"font-family-select",hideLabel:!0,useTabDesign:!0}},[bi(e,"fontSettings")]:{...ji.fontSettings,scope:"common",title:""},[bi(e,"fontSize")]:{...ji.fontSize,scope:"layout",title:""},[bi(e,"lineHeight")]:{...ji.lineHeight,scope:"layout",title:""},[bi(e,"letterSpacing")]:{...ji.letterSpacing,scope:"layout",title:""},[bi(e,"wordSpacing")]:{...ji.wordSpacing,scope:"layout",title:""},[bi(e,"textAlign")]:{...ji.textAlign,scope:"layout",title:""},[bi(e,"textAppearance")]:{...ji.textAppearance,scope:"layout",title:""}}}const lC=ql(""),cC=ql("open"),dC=ql("compact"),uC=["__componentName__",{type:"row",items:["panelHeight","navTextWidth"]},{type:"row",title:"",items:["navTextPosition","navTextOffset"]},{type:"row",title:"Logo",items:["logoMaxHeight","logoPosition"]},{type:"row",title:"Hamburger",items:["iconSize","showIcon"]},"fontFamily","fontSettings",{type:"row",items:["fontSize","lineHeight","letterSpacing","wordSpacing"]},"textAlign","textAppearance","navGap","navPaddingLeft","navPaddingRight"],pC=["__componentName__",{type:"row",items:["compactPanelHeight","compactNavTextWidth"]},{type:"row",title:"",items:["compactNavTextPosition","compactNavTextOffset"]},{type:"row",title:"Logo",items:["compactLogoMaxHeight","compactLogoPosition"]},{type:"row",title:"Hamburger",items:["compactIconSize","compactShowIcon"]},"compactFontFamily","compactFontSettings",{type:"row",items:["compactFontSize","compactLineHeight","compactLetterSpacing","compactWordSpacing"]},"compactTextAlign","compactTextAppearance","compactNavGap","compactNavPaddingLeft","compactNavPaddingRight"],mC=["__componentName__",{type:"row",title:"Text",items:["textWidth","position"]},{type:"row",title:"Menu",items:["openPanelSize","effect"]},"openFontFamily","openFontSettings",{type:"row",items:["openFontSize","openLineHeight","openLetterSpacing","openWordSpacing"]},"openTextAlign","openTextAppearance"],ei={textTransform:"none",textDecoration:"none",fontVariant:"normal"},Ms={fontWeight:400,fontStyle:"normal"},ea={d:"Always",t:"Open Only",m:"Open Only"},gC=["left-top","center-top","right-top","left-center","center","right-center","left-bottom","center-bottom","right-bottom"],hC=["iconColor","logoColor","linkColor","backgroundColor"],fC={type:"object",version:1,settings:{sizing:"auto manual",properties:{link:{type:"array",scope:"common",display:{type:"page-url-link"},items:{type:"object",properties:{link:{type:"object",properties:{type:{type:"string",enum:["url","page","anchor"]},value:{type:"string",message:"Paste URL here..."},target:{type:"string",enum:["blank","self"]},anchor:{type:"string"}}},label:{type:"string"},showIn:{type:"string",scope:"layout",enum:["Always","Open Only","Open and Compact","Default and Open","Default and Compact"]}}}},logo:{type:"object",scope:"common",title:"Logo",display:{type:"button-icon-switch"},properties:{mode:{type:"string",enum:["On","Off"]},icon:{type:["string","null"],title:"Logo",display:{type:"settings-image-input"}}}},logoMaxHeight:{type:"number",scope:"layout",title:"Max Height",display:{type:"numeric-input"},min:0,max:9999},logoPosition:{type:"string",scope:"layout",title:"Position",display:{type:"toggle-cycle",enum:["left","center","right"]}},compactLogoPosition:{type:"string",scope:"layout",title:"Position",display:{type:"toggle-cycle",enum:["left","center","right"]}},logoColor:{type:"string",scope:"common",title:"Logo Default",titleByState:{default:"Logo Default",hover:"Logo Hover"},display:{type:"palette-color-picker"}},panelHeight:{type:"number",scope:"layout",title:"Menu Height",display:{type:"numeric-input"},min:0,max:9999},backgroundColor:{type:"string",scope:"common",title:"BG Default",display:{type:"palette-color-picker"}},iconColor:{type:"string",scope:"common",title:"Icon Default",titleByState:{default:"Icon Default",hover:"Icon Hover"},display:{type:"palette-color-picker"}},showIcon:{type:"string",scope:"layout",title:"Show",display:{type:"toggle-cycle",enum:["on","off"]}},iconSize:{type:"number",scope:"layout",title:"Size",display:{type:"numeric-input"},min:0,max:9999},linkColor:{type:"string",scope:"common",title:"Text Default",titleByState:{default:"Text Default",hover:"Text Hover"},display:{type:"palette-color-picker"}},compactShowIcon:{type:"string",scope:"layout",title:"Show",display:{type:"toggle-cycle",enum:["on","off"]}},compactIconColor:{type:"string",scope:"common",title:"Icon Default",titleByState:{compact:"Icon Default","compact-hover":"Icon Hover"},display:{type:"palette-color-picker"}},compactLinkColor:{type:"string",scope:"common",title:"Text Default",titleByState:{compact:"Text Default","compact-hover":"Text Hover"},display:{type:"palette-color-picker"}},compactLogoColor:{type:"string",scope:"common",title:"Logo Default",titleByState:{compact:"Logo Default","compact-hover":"Logo Hover"},display:{type:"palette-color-picker"}},compactBackgroundColor:{type:"string",scope:"common",title:"BG Default",display:{type:"palette-color-picker"}},openLinkColor:{type:"string",scope:"common",title:"Text Default",titleByState:{open:"Text Default","open-hover":"Text Hover"},display:{type:"palette-color-picker"}},openLogoColor:{type:"string",scope:"common",title:"Logo Default",titleByState:{open:"Logo Default","open-hover":"Logo Hover"},display:{type:"palette-color-picker"}},menuBackgroundColor:{type:"string",scope:"common",title:"BG Default",display:{type:"palette-color-picker"}},overlayColor:{type:"string",scope:"common",title:"Overlay Default",display:{type:"palette-color-picker"}},closeButtonColor:{type:"string",scope:"common",title:"Close Default",titleByState:{open:"Close Default","open-hover":"Close Hover"},display:{type:"palette-color-picker"}},effect:{type:"string",scope:"layout",title:"Effect",display:{type:"toggle-cycle",enum:["fade","left","top","right","bottom"]}},openPanelSize:{type:"number",scope:"layout",title:"Height",display:{type:"percentage-input"},min:0,max:100},textWidth:{type:"number",scope:"layout",title:"Width",display:{type:"numeric-input"},min:0,max:9999},navTextWidth:{type:"number",scope:"layout",title:"Text width",display:{type:"numeric-input"},min:0,max:9999},navTextPosition:{type:"string",scope:"layout",title:"Position",display:{type:"toggle-cycle",enum:["left","center","right"]}},navTextOffset:{type:"number",scope:"layout",title:"Offset",display:{type:"numeric-input"},min:-9999,max:9999},position:{type:"string",scope:"layout",title:"Position",display:{type:"toggle-cycle",enum:[...gC]}},stateOverrides:{type:"object",scope:"common"},gap:tr("Gap"),navGap:{type:"number",scope:"layout",title:"Nav gap",min:0,max:100,display:{type:"range-control",visible:!1}},navPaddingLeft:{type:"number",scope:"layout",title:"Nav padding left",min:0,max:100,display:{type:"range-control",visible:!1}},navPaddingRight:{type:"number",scope:"layout",title:"Nav padding right",min:0,max:100,display:{type:"range-control",visible:!1}},textPaddingLeft:tr("Text padding left"),textPaddingRight:tr("Text padding right"),textPaddingTop:tr("Text padding top"),textPaddingBottom:tr("Text padding bottom"),compactLogoMaxHeight:{type:"number",scope:"layout",title:"Max Height",display:{type:"numeric-input"},min:0,max:9999},compactPanelHeight:{type:"number",scope:"layout",title:"Menu Height",display:{type:"numeric-input"},min:0,max:9999},compactIconSize:{type:"number",scope:"layout",title:"Size",display:{type:"numeric-input"},min:0,max:9999},compactNavTextWidth:{type:"number",scope:"layout",title:"Text width",display:{type:"numeric-input"},min:0,max:9999},compactNavTextPosition:{type:"string",scope:"layout",title:"Position",display:{type:"toggle-cycle",enum:["left","center","right"]}},compactNavTextOffset:{type:"number",scope:"layout",title:"Offset",display:{type:"numeric-input"},min:-9999,max:9999},compactNavGap:{type:"number",scope:"layout",title:"Nav gap",min:0,max:100,display:{type:"range-control",visible:!1}},compactNavPaddingLeft:{type:"number",scope:"layout",title:"Nav padding left",min:0,max:100,display:{type:"range-control",visible:!1}},compactNavPaddingRight:{type:"number",scope:"layout",title:"Nav padding right",min:0,max:100,display:{type:"range-control",visible:!1}},...lC,...cC,...dC},defaults:{link:[{link:{type:"page",value:"",target:"self"},label:"Home",showIn:ea},{link:{type:"page",value:"",target:"self"},label:"Works",showIn:ea},{link:{type:"page",value:"",target:"self"},label:"About",showIn:ea},{link:{type:"page",value:"",target:"self"},label:"Contact",showIn:ea}],logo:{mode:"On",icon:"01M3QM74XE09DSJCWGD1XM6Y45"},backgroundColor:"#ffffff",logoColor:"#000000",iconColor:"#000000",linkColor:"#000000",openLinkColor:"#000000",compactIconColor:"#000000",compactLinkColor:"#000000",compactLogoColor:"#000000",compactBackgroundColor:"#ffffff",openLogoColor:"#000000",menuBackgroundColor:"#ffffff",overlayColor:"rgba(0, 0, 0, 0.45)",closeButtonColor:"#000000",effect:"fade",showIcon:"on",compactShowIcon:"on",logoPosition:"left",compactLogoPosition:"left",navTextPosition:"center",compactNavTextPosition:"center",navTextOffset:0,compactNavTextOffset:0,position:"left-top",fontFamily:"Goudy Bookletter 1911",fontSettings:Ms,textAlign:"left",openFontFamily:"Goudy Bookletter 1911",openFontSettings:Ms,openTextAlign:"left",compactFontFamily:"Goudy Bookletter 1911",compactFontSettings:Ms,compactTextAlign:"left",stateOverrides:{hover:{linkColor:"#666666",iconColor:"#666666",logoColor:"#666666"},"open-hover":{closeButtonColor:"#666666"}}},displayRules:[{if:{name:"logo.mode",value:"Off"},then:{name:"properties.logoMaxHeight.display.visible",value:!1}},{if:{name:"logo.mode",value:"Off"},then:{name:"properties.logoPosition.display.visible",value:!1}},{if:{name:"logo.mode",value:"Off"},then:{name:"properties.compactLogoMaxHeight.display.visible",value:!1}},{if:{name:"logo.mode",value:"Off"},then:{name:"properties.compactLogoPosition.display.visible",value:!1}},{if:{name:"logo.mode",value:"Off"},then:{name:"properties.logoColor.display.visible",value:!1}},{if:{name:"logo.mode",value:"Off"},then:{name:"properties.compactLogoColor.display.visible",value:!1}},{if:{name:"logo.mode",value:"Off"},then:{name:"properties.openLogoColor.display.visible",value:!1}},{if:{name:"effect",value:"left"},then:{name:"properties.openPanelSize.title",value:"Width"}},{if:{name:"effect",value:"right"},then:{name:"properties.openPanelSize.title",value:"Width"}},{if:{name:"showIcon",value:"off"},then:{name:"properties.iconSize.display.visible",value:!1}},{if:{name:"showIcon",value:"off"},then:{name:"properties.iconColor.display.visible",value:!1}},{if:{name:"compactShowIcon",value:"off"},then:{name:"properties.compactIconSize.display.visible",value:!1}},{if:{name:"compactShowIcon",value:"off"},then:{name:"properties.compactIconColor.display.visible",value:!1}}],layoutDefaults:{m:{position:"center",panelHeight:50/375,logoMaxHeight:30/375,logoPosition:"center",compactLogoPosition:"left",navTextPosition:"center",navTextOffset:0,compactNavTextPosition:"center",compactNavTextOffset:0,showIcon:"on",iconSize:30/375,textWidth:240/375,openPanelSize:100,navTextWidth:120/375,gap:24/375,navGap:24/375,navPaddingLeft:20/375,navPaddingRight:20/375,textPaddingLeft:10/375,textPaddingRight:10/375,textPaddingTop:10/375,textPaddingBottom:10/375,fontSize:16/375,lineHeight:20/375,letterSpacing:0,wordSpacing:0,textAppearance:ei,openFontSize:34/375,openLineHeight:20/375,openLetterSpacing:0,openWordSpacing:0,openTextAppearance:ei,openTextAlign:"center",compactPanelHeight:40/375,compactLogoMaxHeight:20/375,compactShowIcon:"on",compactIconSize:16/375,compactNavTextWidth:80/375,compactNavGap:24/375,compactNavPaddingLeft:20/375,compactNavPaddingRight:20/375,compactFontSize:16/375,compactLineHeight:20/375,compactLetterSpacing:0,compactWordSpacing:0,compactTextAppearance:ei},t:{textAlign:"center",position:"center",panelHeight:60/768,logoMaxHeight:30/768,logoPosition:"left",compactLogoPosition:"left",navTextPosition:"center",navTextOffset:0,compactNavTextPosition:"center",compactNavTextOffset:0,showIcon:"on",iconSize:16/768,textWidth:300/768,openPanelSize:100,navTextWidth:90/768,gap:32/768,navGap:32/768,navPaddingLeft:20/768,navPaddingRight:20/768,textPaddingLeft:10/768,textPaddingRight:10/768,textPaddingTop:10/768,textPaddingBottom:10/768,fontSize:18/768,lineHeight:20/768,letterSpacing:0,wordSpacing:0,textAppearance:ei,openFontSize:75/768,openLineHeight:20/768,openLetterSpacing:0,openWordSpacing:0,openTextAppearance:ei,openTextAlign:"center",compactTextAlign:"center",compactPanelHeight:40/768,compactLogoMaxHeight:20/768,compactShowIcon:"on",compactIconSize:16/768,compactNavTextWidth:80/768,compactNavGap:32/768,compactNavPaddingLeft:20/768,compactNavPaddingRight:20/768,compactFontSize:16/768,compactLineHeight:20/768,compactLetterSpacing:0,compactWordSpacing:0,compactTextAppearance:ei},d:{position:"center",panelHeight:50/1440,logoMaxHeight:30/1440,logoPosition:"left",compactLogoPosition:"left",navTextPosition:"center",navTextOffset:0,compactNavTextPosition:"center",compactNavTextOffset:0,showIcon:"on",iconSize:20/1440,textWidth:300/1440,openPanelSize:100,navTextWidth:60/1440,gap:12/1440,navGap:64/1440,navPaddingLeft:10/1440,navPaddingRight:10/1440,textPaddingLeft:10/1440,textPaddingRight:10/1440,textPaddingTop:10/1440,textPaddingBottom:10/1440,fontSize:16/1440,lineHeight:16/1440,letterSpacing:0,wordSpacing:0,textAppearance:ei,textAlign:"center",openFontSize:90/1440,openLineHeight:16/1440,openLetterSpacing:0,openWordSpacing:0,openTextAppearance:ei,openTextAlign:"center",compactPanelHeight:30/1440,compactLogoMaxHeight:20/1440,compactShowIcon:"on",compactIconSize:20/1440,compactNavTextWidth:60/1440,compactNavGap:20/1440,compactNavPaddingLeft:10/1440,compactNavPaddingRight:10/1440,compactFontSize:16/1440,compactLineHeight:16/1440,compactLetterSpacing:0,compactWordSpacing:0,compactTextAppearance:ei,compactTextAlign:"center"}},layout:["__componentName__","link","logo","logoMaxHeight","logoPosition","panelHeight","backgroundColor","logoColor","iconColor","showIcon","iconSize","linkColor","openLinkColor","compactShowIcon","compactIconColor","compactLinkColor","compactLogoColor","compactBackgroundColor","compactLogoMaxHeight","compactLogoPosition","compactPanelHeight","compactIconSize","compactNavTextWidth","compactNavTextPosition","compactNavTextOffset","compactNavGap","compactNavPaddingLeft","compactNavPaddingRight","compactFontFamily","compactFontSettings","compactFontSize","compactLineHeight","compactLetterSpacing","compactWordSpacing","compactTextAlign","compactTextAppearance","openLogoColor","menuBackgroundColor","overlayColor","closeButtonColor","effect","textWidth","navTextWidth","navTextPosition","navTextOffset","position","gap","navGap","navPaddingLeft","navPaddingRight","textPaddingLeft","textPaddingRight","textPaddingTop","textPaddingBottom","fontFamily","fontSettings","fontSize","lineHeight","letterSpacing","wordSpacing","textAlign","textAppearance","openFontFamily","openFontSettings","openFontSize","openLineHeight","openLetterSpacing","openWordSpacing","openTextAlign","openTextAppearance"]},panels:[{id:"general",icon:"settings",title:"General",tooltip:"General Settings",layout:["__componentName__","logo"]},{id:"default",icon:"default",title:"Default",tooltip:"Default State",layout:uC},{id:"compact",icon:"compact",title:"Compact",tooltip:"Compact State",layout:pC,availableWhen:{navigationPosition:["switch"]}},{id:"open",icon:"open",title:"Open",tooltip:"Open State",layout:mC},{id:"links",icon:"content",title:"Links",tooltip:"Link Settings",layout:["__componentName__","link"]}],paletteBookmark:{items:[...hC],panelIds:["default","compact","open"],stateItems:{default:["iconColor","logoColor","linkColor","backgroundColor"],hover:["iconColor","logoColor","linkColor"],compact:["compactIconColor","compactLogoColor","compactLinkColor","compactBackgroundColor"],"compact-hover":["compactIconColor","compactLogoColor","compactLinkColor"],open:["closeButtonColor","openLogoColor","openLinkColor","menuBackgroundColor","overlayColor"],"open-hover":["closeButtonColor","openLogoColor","openLinkColor"]}},states:["default","hover"],statePanels:["default","compact","open"]},yC={element:aC,id:"basic-burger",name:"Basic Burger",category:"navigation",version:1,preview:{type:"image",url:"https://cdn.cntrl.site/component-assets/Simple Burger.png"},layoutMode:"navigation",defaultSize:{d:{width:"100%",height:60/1440},t:{width:"100%",height:60/768},m:{width:"100%",height:56/375}},defaultNavigationPosition:{d:"switch",t:"switch",m:"stickyTop"},schema:fC,sourceCode:sC,assetsPaths:{content:[],parameters:[{path:"logo.icon",placeholderEnabled:!0}]},fontSettingsPaths:{content:[],parameters:[{path:"fontFamily"},{path:"openFontFamily"},{path:"compactFontFamily"}]},fontRelations:{fontSettings:"fontFamily",openFontSettings:"openFontFamily",compactFontSettings:"compactFontFamily"}},Od=120,Dd=3,vC=.12,Kl={x:0,y:0,width:100,height:100};function $o(e,t){return e.map(n=>n.map(i=>({x:(i.x-t.x)/t.width,y:(i.y-t.y)/t.height})))}function La(e){return e<0?0:e>1?1:e}function zd(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 xC(e,t){let n=1/0,i=1/0,o=-1/0,r=-1/0;for(const d of e)for(const u of d){const p=u.x*t.width,y=u.y*t.height;p<n&&(n=p),p>o&&(o=p),y<i&&(i=y),y>r&&(r=y)}const l=o-n,c=r-i;return!isFinite(l)||!isFinite(c)||l<=0||c<=0?null:{x:n,y:i,width:l,height:c}}function bC(e){return e.map(([t,n])=>({x:t,y:n}))}function Es(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 SC(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=La(n[o]),l=La(n[o+1]);l>r&&i.push({x0:r,x1:l})}return wC(i)}function wC(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 $C(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 CC(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 TC(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 IC(e,t,n,i){let o=null;for(let r=0;r<Dd;r+=1){const l=La(t+(n-t)*r/Math.max(1,Dd-1)),c=SC(e,l),d=i==="avoid"?CC(c):c;if(o=o===null?d:$C(o,d),o.length===0)return[]}return o??[]}function Bd(e,t="stretch",n=Kl){const i=e.trim();if(!i)return null;if(/^[Mm]/.test(i)){const l=ki(i),c=$r(l);if(c.length)return t==="viewbox"?$o(c,n):Es(c);if(typeof document>"u")return null;const d=i.split(/(?=[Mm])/).map(y=>y.trim()).filter(Boolean),u=document.createElementNS("http://www.w3.org/2000/svg","svg"),p=[];for(const y of d){const S=document.createElementNS("http://www.w3.org/2000/svg","path");S.setAttribute("d",y),u.appendChild(S);let m=0;try{m=S.getTotalLength()}catch{m=0}if(!m)continue;const h=[];for(let x=0;x<Od;x+=1){const w=S.getPointAtLength(x/Od*m);h.push({x:w.x,y:w.y})}p.push(h)}return p.length?t==="viewbox"?$o(p,n):Es(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"?$o([r],n):Es([r])}const Yl={bobbin:"M57.63,0 L57.63,37.24 L74.66,37.24 L74.66,56.07 L57.63,100 L33.84,100 L16.81,56.07 L16.81,37.24 L33.84,37.24 L33.84,0 Z",circle:"M50,0 C77.61,0 100,22.39 100,50 C100,77.61 77.61,100 50,100 C22.39,100 0,77.61 0,50 C0,22.39 22.39,0 50,0 Z",shield:"M0,0 L100,0 L100,50 L50,100 L0,50 Z",vase:"M25.37,0 L91.55,0 C91.55,0 74.8,25.14 83.07,50.03 C91.34,74.92 74.61,100 74.61,100 L8.43,100 C8.43,100 32.3,75.08 23.9,50 C15.5,24.92 25.37,0 25.37,0 Z",parallelogram:"M25.37,0 L91.55,0 L74.61,100 L8.43,100 Z",diamond:"M50,0 L80,50 L50,100 L20,50 Z"},Js="0 0 100 100",Pa=100,el=16,LC=12,PC=16,Rs=/([MmZzLlHhVvCcSsQqTtAa])([^MmZzLlHhVvCcSsQqTtAa]*)/g,MC=/[+-]?(?:\d*\.\d+|\d+\.?)(?:[eE][+-]?\d+)?/g,jd=Math.PI/4,EC=8,RC=Math.PI/18,kC=8,fo=24,yo=[];function AC(){return[{closed:!0,nodes:[{p:{x:0,y:0},in:null,out:null},{p:{x:1,y:0},in:null,out:null},{p:{x:1,y:1},in:null,out:null},{p:{x:0,y:1},in:null,out:null}]}]}function ks(e,t){return un(e,n=>({x:(n.x-t.x)/t.width,y:(n.y-t.y)/t.height}))}function FC(e){const t=Li(e),n=t.maxX-t.minX,i=t.maxY-t.minY;return!isFinite(n)||!isFinite(i)||n<=0||i<=0?e:un(e,o=>({x:(o.x-t.minX)/n,y:(o.y-t.minY)/i}))}function NC(e,t){if(!(t.width>0)||!(t.height>0))return e;const n=Math.min(t.width,t.height),i=(t.width-n)/2,o=(t.height-n)/2;return un(e,r=>({x:(i+r.x*n)/t.width,y:(o+r.y*n)/t.height}))}function Vd(e,t,n,i,o,r){let l=[];if(t&&t.length)l=ks(t,i);else{const c=e.trim();if(c&&/^[Mm]/.test(c)){const d=ki(c);d.length&&(l=n==="viewbox"?ks(d,i):FC(d))}if(!l.length){const d=o!=="custom"?Yl[o]:void 0;d?l=ks(ki(d),Kl):l=AC()}}return o==="circle"?NC(l,r):l}function Gd(e,t){return!(t.width>0)||!(t.height>0)||!e.length?"":Ho(un(e,n=>({x:n.x*t.width,y:n.y*t.height})))}function tl(e){const t=e==="rectangle"||e==="custom"?void 0:Yl[e];return t?$o($r(ki(t)),Kl):[bC([[0,0],[1,0],[1,1],[0,1]])]}function _C(e){const t=e.match(MC);return t?t.map(Number).filter(n=>!Number.isNaN(n)):[]}function Ln(e,t,n){return{x:e.x+(t.x-e.x)*n,y:e.y+(t.y-e.y)*n}}function nl(e,t){return{x:t.x*2-e.x,y:t.y*2-e.y}}function gn(e){return{x:e.x,y:e.y}}function HC(e){return{p:gn(e.p),in:e.in?gn(e.in):null,out:e.out?gn(e.out):null}}function Vn(e){return e.map(t=>({closed:t.closed,nodes:t.nodes.map(HC)}))}function un(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 Xd(e,t,n,i=n){return un(e,o=>({x:t.x+(o.x-t.x)*n,y:t.y+(o.y-t.y)*i}))}function WC(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:gn(e),c2:gn(l),p:gn(l)}];const u=i*Math.PI/180,p=Math.cos(u),y=Math.sin(u),S=(e.x-l.x)/2,m=(e.y-l.y)/2,h=p*S+y*m,x=-y*S+p*m,w=h*h/(c*c)+x*x/(d*d);if(w>1){const U=Math.sqrt(w);c*=U,d*=U}const F=o===r?-1:1,v=c*c*x*x+d*d*h*h,P=Math.max(0,c*c*d*d-v),M=v===0?0:F*Math.sqrt(P/v),K=M*c*x/d,X=-M*d*h/c,j=p*K-y*X+(e.x+l.x)/2,N=y*K+p*X+(e.y+l.y)/2,_=Math.atan2((x-X)/d,(h-K)/c);let L=Math.atan2((-x-X)/d,(-h-K)/c)-_;!r&&L>0&&(L-=Math.PI*2),r&&L<0&&(L+=Math.PI*2);const Y=Math.max(1,Math.ceil(Math.abs(L)/(Math.PI/2))),R=L/Y,I=4/3*Math.tan(R/4),$=(U,E)=>({x:j+p*c*U-y*d*E,y:N+y*c*U+p*d*E}),G=[];let O=_;for(let U=0;U<Y;U+=1){const E=O+R,f=Math.cos(O),Q=Math.sin(O),q=Math.cos(E),pe=Math.sin(E);G.push({c1:$(f-I*Q,Q+I*f),c2:$(q+I*pe,pe-I*q),p:U===Y-1?gn(l):$(q,pe)}),O=E}return G}function ki(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 m=i[0],h=i[i.length-1];Math.abs(m.p.x-h.p.x)<1e-6&&Math.abs(m.p.y-h.p.y)<1e-6&&(m.in=h.in??m.in,i.pop())}i.length>1&&n.push({nodes:i,closed:o}),i=[],o=!1},p=(m,h)=>{i.push({p:m,in:Un(h??null,m),out:null}),r=m},y=m=>{if(!i.length)return;const h=i[i.length-1];h.out=Un(m,h.p)};Rs.lastIndex=0;let S=Rs.exec(t);for(;S!==null;){const m=S[1],h=m.toUpperCase(),x=m!==h,w=_C(S[2]),F=v=>x?{x:r.x+w[v],y:r.y+w[v+1]}:{x:w[v],y:w[v+1]};if(h==="Z")o=!0,u(),r=gn(l),c=null,d=null;else if(h==="M"){for(let v=0;v+1<w.length;v+=2){const P=F(v);v===0&&(u(),l=gn(P)),p(P)}c=null,d=null}else if(h==="L"){for(let v=0;v+1<w.length;v+=2)p(F(v));c=null,d=null}else if(h==="H"){for(const v of w)p({x:x?r.x+v:v,y:r.y});c=null,d=null}else if(h==="V"){for(const v of w)p({x:r.x,y:x?r.y+v:v});c=null,d=null}else if(h==="C"){for(let v=0;v+5<w.length;v+=6){const P=F(v),M=F(v+2),K=F(v+4);y(P),p(K,M),c=M}d=null}else if(h==="S"){for(let v=0;v+3<w.length;v+=4){const P=c?nl(c,r):gn(r),M=F(v),K=F(v+2);y(P),p(K,M),c=M}d=null}else if(h==="Q")for(let v=0;v+3<w.length;v+=4){const P=F(v),M=F(v+2);y(Ln(r,P,2/3)),p(M,Ln(M,P,2/3)),d=P,c=null}else if(h==="T")for(let v=0;v+1<w.length;v+=2){const P=d?nl(d,r):gn(r),M=F(v);y(Ln(r,P,2/3)),p(M,Ln(M,P,2/3)),d=P,c=null}else if(h==="A")for(let v=0;v+6<w.length;v+=7){const P=x?{x:r.x+w[v+5],y:r.y+w[v+6]}:{x:w[v+5],y:w[v+6]};for(const M of WC(r,w[v],w[v+1],w[v+2],w[v+3]!==0,w[v+4]!==0,P))y(M.c1),p(M.p,M.c2);c=null,d=null}S=Rs.exec(t)}return u(),n}function Bn(e){return`${Number(e.toFixed(2))}`}function Un(e,t){return!e||Math.abs(e.x-t.x)<1e-6&&Math.abs(e.y-t.y)<1e-6?null:e}function jp(e){return!!(Un(e.in,e.p)||Un(e.out,e.p))}function Vo(e,t){return!Un(e.out,e.p)&&!Un(t.in,t.p)}function Ud(e,t){if(Vo(e,t))return`L${Bn(t.p.x)},${Bn(t.p.y)}`;const n=Un(e.out,e.p)??e.p,i=Un(t.in,t.p)??t.p;return`C${Bn(n.x)},${Bn(n.y)} ${Bn(i.x)},${Bn(i.y)} ${Bn(t.p.x)},${Bn(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${Bn(i.p.x)},${Bn(i.p.y)}`);let r=i;for(const l of o)t.push(Ud(r,l)),r=l;if(n.closed){const l=Ud(r,i);l.charAt(0)==="C"&&t.push(l),t.push("Z")}}return t.join(" ")}function Vp(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 il(e,t,n){if(Vo(e,t))return Ln(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 $r(e){const t=[];for(const n of e){if(n.nodes.length<2)continue;const i=[];for(const o of Vp(n)){if(Vo(o.from,o.to)){i.push(gn(o.from.p));continue}for(let r=0;r<el;r+=1)i.push(il(o.from,o.to,r/el))}n.closed||i.push(gn(n.nodes[n.nodes.length-1].p)),i.length>2&&t.push(i)}return t}function Li(e){let t=1/0,n=1/0,i=-1/0,o=-1/0;for(const r of $r(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 OC(e){const t=Li(e);return!isFinite(t.minX)||!isFinite(t.maxX)||!isFinite(t.minY)||!isFinite(t.maxY)?null:{x:(t.minX+t.maxX)/2,y:(t.minY+t.maxY)/2}}function Gp(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 Xp(e){return e.filter(t=>t.length>2).map(t=>{if(t.length<=LC)return{closed:!0,nodes:t.map(r=>({p:gn(r),in:null,out:null}))};const n=Math.max(1,Math.round(t.length/PC)),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:gn(r),...Gp(i[(l-1+o)%o],r,i[(l+1)%o])}))}})}function Up(e,t,n=1){if(!e.length)return!1;const i=Li(e);if(!isFinite(i.minX)||!isFinite(i.maxX))return!1;const o=i.maxX-i.minX,r=i.maxY-i.minY;if(o<=t.width*2.5&&r<=t.height*2.5)return!1;const l=Math.max(n,t.width*.5),c=Math.max(n,t.height*.5);return i.minX<t.x-l||i.minY<t.y-c||i.maxX>t.x+t.width+l||i.maxY>t.y+t.height+c}function DC(e,t,n,i,o,r,l){const c=t.width>0?n.width/t.width:1,d=t.height>0?n.height/t.height:1;return!(r>0)||!(l>0)||!(c>0)||!(d>0)?e:un(e,u=>{const p=i+(u.x-t.x)*r,y=o+(u.y-t.y)*l;return{x:t.x+p/c,y:t.y+y/d}})}function zC(e,t){if(!e.length)return e;const n=Li(e),i=n.maxX-n.minX,o=n.maxY-n.minY;if(!(i>0)||!(o>0)||n.minX>=t.x-1e-6&&n.minY>=t.y-1e-6&&n.maxX<=t.x+t.width+1e-6&&n.maxY<=t.y+t.height+1e-6)return e;const l=Math.min(t.width/i,t.height/o),c=t.x+(t.width-i*l)/2,d=t.y+(t.height-o*l)/2;return un(e,u=>({x:c+(u.x-n.minX)*l,y:d+(u.y-n.minY)*l}))}function qp(e){const t={x:0,y:0,width:Pa,height:Pa},n=e!=="custom"?Yl[e]:void 0,i=n?un(ki(n),r=>({x:r.x/100*t.width+t.x,y:r.y/100*t.height+t.y})):un(Xp(tl("rectangle")),r=>({x:r.x*t.width+t.x,y:r.y*t.height+t.y})),o=zC(i,t);return{shape:e,customPath:Ho(o),pathFit:"viewbox",pathViewBox:Js}}function ta(e,t){return t>0?Math.round(e/t)*t:e}function BC(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=Vn(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 qd(e,t,n,i){var r;if(!t.length)return e;const o=Vn(e);for(const{contour:l,node:c}of t){const d=(r=o[l])==null?void 0:r.nodes[c];d&&(d.p={x:d.p.x+n,y:d.p.y+i},d.in&&(d.in={x:d.in.x+n,y:d.in.y+i}),d.out&&(d.out={x:d.out.x+n,y:d.out.y+i}))}return o}function jC(e,t){const n=new Map;for(const{contour:o,node:r}of t){const l=n.get(o)??[];l.push(r),n.set(o,l)}let i=e;return n.forEach((o,r)=>{const l=[...o].sort((c,d)=>d-c);for(const c of l)i=Kp(i,r,c)}),i}function VC(e,t,n,i,o,r){var u;if(!((u=e[t])==null?void 0:u.nodes[n]))return e;const c=Vn(e),d=c[t].nodes[n];if(d[i]=gn(o),r){const p=i==="in"?"out":"in";d[p]=nl(o,d.p)}return c}function GC(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=Vn(e);return r[t].nodes[n][i]=null,r}function XC(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=Vn(e),d=c[t].nodes,u=n+1;if(Vo(r,l))return d.splice(u,0,{p:Ln(r.p,l.p,i),in:null,out:null}),{contours:c,nodeIndex:u};const p=r.out??r.p,y=l.in??l.p,S=Ln(r.p,p,i),m=Ln(p,y,i),h=Ln(y,l.p,i),x=Ln(S,m,i),w=Ln(m,h,i),F=Ln(x,w,i),v=(n+1)%o.nodes.length;return d[n].out=S,d[v].in=h,d.splice(u,0,{p:F,in:x,out:w}),{contours:c,nodeIndex:u}}function Kp(e,t,n){const i=e[t];if(!i||i.nodes.length<=3)return e;const o=Vn(e);return o[t].nodes.splice(n,1),o}function Kd(e,t,n){const i=e[t];if(!(i==null?void 0:i.nodes[n]))return e;const r=Vn(e),l=r[t].nodes,c=l[n],d=l.length,u=(n-1+d)%d,p=(n+1)%d,y=!!Un(l[u].out,l[u].p),S=!!Un(l[p].in,l[p].p);if(jp(c)||y||S)return c.in=null,c.out=null,l[u].out=null,l[p].in=null,r;const m=Gp(l[u].p,c.p,l[p].p);return c.in=m.in,c.out=m.out,r}function UC(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),point:c}}function Yd(e,t){let n=null;return e.forEach((i,o)=>{for(const r of Vp(i)){const l=Vo(r.from,r.to)?1:el;for(let c=0;c<l;c+=1){const d=c/l,u=(c+1)/l,p=UC(t,il(r.from,r.to,d),il(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,point:p.point})}}}),n}function qC(e,t){const n=[];return e.forEach((i,o)=>{i.nodes.forEach((r,l)=>{o===t.contour&&l===t.node||n.push(r.p)})}),n}function Qd(e,t,n){const i=t.filter((r,l)=>isFinite(r)&&t.findIndex(c=>Math.abs(c-r)<1e-6)===l),o=i.map(r=>({value:r,axis:r,from:null}));for(const r of e)o.push({value:r[n],axis:null,from:r});for(const r of i)for(const l of e)o.push({value:r*2-l[n],axis:r,from:l});return o}function Zd(e,t,n,i,o){const r=i(t)[n];let l=null,c=1/0;for(const d of e){const u=n==="x"?{x:d.value,y:t.y}:{x:t.x,y:d.value},p=Math.abs(i(u)[n]-r);p>o||l&&p>=c||(l=d,c=p)}return l}function KC(e,t){return e.length===t.length&&e.every((n,i)=>n.kind===t[i].kind&&n.a.x===t[i].a.x&&n.a.y===t[i].a.y&&n.b.x===t[i].b.x&&n.b.y===t[i].b.y)}function YC(e){const t=Math.PI*2;return((e+Math.PI)%t+t)%t-Math.PI}function ol(e,t){const n=t.x-e.x,i=t.y-e.y,o=Math.hypot(n,i);return o<1e-6?null:{x:n/o,y:i/o}}function QC(e,t){const n=ol(e,t);return n?{kind:"align",a:{x:e.x-n.x*fo,y:e.y-n.y*fo},b:{x:t.x+n.x*fo,y:t.y+n.y*fo}}:{kind:"align",a:e,b:t}}function rl(e,t,n){return t==="x"?{kind:"center",a:{x:e,y:0},b:{x:e,y:n.height}}:{kind:"center",a:{x:0,y:e},b:{x:n.width,y:e}}}function Jd(e,t,n,i,o){if(e.axis===null)return QC(n,o(e.from??n));const r=t==="x"?{x:e.axis,y:0}:{x:0,y:e.axis};return rl(o(r)[t],t,i)}function ZC(e,t,n,i,o){const r=[],l=o(e);return t&&e.x===t.value&&r.push(Jd(t,"x",l,i,o)),n&&e.y===n.value&&r.push(Jd(n,"y",l,i,o)),r}function JC(e,t,n,i){const o=e==null?void 0:e.nodes[t];if(!e||!o)return null;const r=i(o.p),l=n==="in"?o.out:o.in;if(l)return ol(i(l),r);const c=e.nodes.length,d=t+(n==="in"?1:-1);if(!e.closed&&(d<0||d>=c))return null;const u=e.nodes[(d+c)%c];if(!u)return null;const p=(n==="in"?u.in:u.out)??u.p;return ol(i(p),r)}function eT(e,t,n,i,o,r,l){const c=r(t),d=r(e),u=d.x-c.x,p=d.y-c.y,y=Math.hypot(u,p);if(y<1e-6)return{point:e,guides:yo};const S=Math.atan2(p,u),m=Math.round(S/jd)*jd;let h=o?m:null,x=!1;if(!o){const X=[];n&&X.push({angle:Math.atan2(n.y,n.x),smooth:!0}),X.push({angle:m,smooth:!1});for(const j of X){const N=YC(j.angle-S);if(!(Math.abs(N)>RC)&&!(Math.abs(Math.sin(N))*y>EC)){h=j.angle,x=j.smooth;break}}}const w=i!==null&&i>0&&Math.abs(y-i)<=kC;if(h===null&&!w)return{point:e,guides:yo};const F=h??S,v=w?i:y,P={x:Math.cos(F),y:Math.sin(F)},M=v+(h===null?0:fo),K=w?v:x?fo:0;return{point:l({x:c.x+P.x*v,y:c.y+P.y*v}),guides:[{kind:"angle",a:{x:c.x-P.x*K,y:c.y-P.y*K},b:{x:c.x+P.x*M,y:c.y+P.y*M}}]}}const al=.1,sl=8,tT=4,eu=10,Ma=(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}}},Yp=e=>{switch(e){case"nw":return"se";case"ne":return"sw";case"se":return"nw";case"sw":return"ne"}},ll=(e,t)=>{const n=Ma(e,t),i=t==="nw"||t==="sw"?-1:1,o=t==="nw"||t==="ne"?-1:1;return{x:n.x+i*eu,y:n.y+o*eu}},cl=(e,t)=>!(t.width>0)||!(t.height>0)||!(e.width>0)||!(e.height>0)?1:Math.max(e.width/t.width,e.height/t.height),Ui=(e,t,n)=>{const i=cl(e,t)*n;return{width:t.width*i,height:t.height*i}},jn=(e,t,n)=>(e-t)*n,vo=(e,t,n,i)=>{const o=e-t;if(Math.abs(o)<1e-6)return .5;const r=n/o;return(i==null?void 0:i.clamp)===!1?r:Math.abs(o)<tT?.5:La(r)},nT=(e,t,n,i,o,r)=>{const l=Ui(e,n,r),c=e.x+jn(e.width,l.width,i),d=e.y+jn(e.height,l.height,o),u=cl(e,n),p=cl(t,n),y=Math.min(sl,Math.max(al,p>0?r*(u/p):r)),S=Ui(t,n,y);return{focalX:vo(t.width,S.width,c-t.x,{clamp:!1}),focalY:vo(t.height,S.height,d-t.y,{clamp:!1}),scale:y}},iT=6,oT=3,rT=2,As="",aT=new RegExp("\\p{L}","gu"),tu=20,sT={arb:"ar",azj:"az",bel:"be",bos:"bs",bul:"bg",ces:"cs",deu:"de",eng:"en",fas:"fa",fra:"fr",hau:"ha",hin:"hi",hrv:"hr",hun:"hu",ibo:"ig",ind:"id",ita:"it",jav:"jv",kaz:"kk",kin:"rw",lin:"ln",mar:"mr",nep:"ne",nld:"nl",nya:"ny",pol:"pl",por:"pt",ron:"ro",run:"rn",rus:"ru",som:"so",spa:"es",srp:"sr",sun:"su",swe:"sv",swh:"sw",tgl:"tl",tur:"tr",ukr:"uk",urd:"ur",uzn:"uz",vie:"vi",yor:"yo",zlm:"ms",zul:"zu"},dl={be:()=>Promise.resolve().then(()=>require("./index-B1vNL0m-.js")).then(e=>e.index),bg:()=>Promise.resolve().then(()=>require("./index-kFrlcZxC.js")).then(e=>e.index),cs:()=>Promise.resolve().then(()=>require("./index-B6E31HBG.js")).then(e=>e.index),de:()=>Promise.resolve().then(()=>require("./index-CNFsG2yO.js")).then(e=>e.index),en:()=>Promise.resolve().then(()=>require("./index-x_p4zv7D.js")).then(e=>e.index),"en-gb":()=>Promise.resolve().then(()=>require("./index-BkmSPu6z.js")).then(e=>e.index),es:()=>Promise.resolve().then(()=>require("./index-CADju5Cy.js")).then(e=>e.index),fr:()=>Promise.resolve().then(()=>require("./index-Rwqfce2n.js")).then(e=>e.index),hi:()=>Promise.resolve().then(()=>require("./index-HhE2sJlU.js")).then(e=>e.index),hr:()=>Promise.resolve().then(()=>require("./index-DapMA5nM.js")).then(e=>e.index),hu:()=>Promise.resolve().then(()=>require("./index-kjKI70JX.js")).then(e=>e.index),id:()=>Promise.resolve().then(()=>require("./index-BlAuAthm.js")).then(e=>e.index),it:()=>Promise.resolve().then(()=>require("./index-BK-G0i5L.js")).then(e=>e.index),mr:()=>Promise.resolve().then(()=>require("./index-CIgabTwE.js")).then(e=>e.index),nl:()=>Promise.resolve().then(()=>require("./index-BrL2zv3x.js")).then(e=>e.index),pl:()=>Promise.resolve().then(()=>require("./index-DehKWXGA.js")).then(e=>e.index),pt:()=>Promise.resolve().then(()=>require("./index-C0cxTf5o.js")).then(e=>e.index),ro:()=>Promise.resolve().then(()=>require("./index-CJ0NMfJ3.js")).then(e=>e.index),ru:()=>Promise.resolve().then(()=>require("./index-gBhj9Tcu.js")).then(e=>e.index),sr:()=>Promise.resolve().then(()=>require("./index-1HMblVmZ.js")).then(e=>e.index),sv:()=>Promise.resolve().then(()=>require("./index-CDO1-R3j.js")).then(e=>e.index),tr:()=>Promise.resolve().then(()=>require("./index-CG_43X7q.js")).then(e=>e.index),uk:()=>Promise.resolve().then(()=>require("./index-Ypt3vHbi.js")).then(e=>e.index)},lT=(e,t)=>{const n=e;return t(n)??t(n.default)??null};let nu=null;const cT=()=>(nu??(nu=Promise.resolve().then(()=>require("./index-2JTNRDR1.js")).then(e=>e.franc).catch(()=>null)),nu),iu=new Map,dT=e=>{let t=iu.get(e);return t||(t=dl[e]().then(n=>lT(n,i=>i==null?void 0:i.hyphenateSync)).catch(()=>null),iu.set(e,t)),t},ou=e=>{if(!e)return null;const t=e.toLowerCase();if(dl[t])return t;const n=t.split("-")[0];return dl[n]?n:null},uT=(e,t)=>{const n=t.trim();if(n.length<tu)return;const i=e(n,{minLength:tu});if(i!=="und")return sT[i]??i},pT={hyphenateSync:null};function mT(e,t){const[n,i]=s.useState(null);return s.useEffect(()=>{if(!e)return;let o=!1;return cT().then(async r=>{const l=r?uT(r,t):void 0,c=typeof document<"u"?document.documentElement.lang:"",d=ou(l)??ou(c)??"en",u=await dT(d);o||i({lang:l,hyphenateSync:u})}),()=>{o=!0}},[e,t]),e&&n?n:pT}const ru=e=>{var t;return((t=e.match(aT))==null?void 0:t.length)??0};function gT(e,t){if(e.length<2||e.includes(As))return;const n=new Set;if(t){const o=t(e,{hyphenChar:As,minWordLength:iT});let r=0;for(let l=0;l<o.length;l+=1)o[l]===As?n.add(r):r+=1}for(let o=1;o<e.length-1;o+=1)e[o-1]==="-"&&n.add(o);const i=[...n].filter(o=>{const r=e[o-1]==="-";return o>0&&o<e.length&&ru(e.slice(0,o))>=(r?1:oT)&&ru(e.slice(o))>=(r?1:rT)}).sort((o,r)=>o-r);return i.length?i:void 0}const au=1.08,na=14,ia=8;function hT({P:e,box:t,bounds:n,natural:i,imageUrl:o,maskPath:r,stage:l,onStageChange:c,focalX:d,focalY:u,scale:p,onChange:y,onCommit:S}){const m=s.useRef(null),h=`pretext-image-ghost-${s.useId().replace(/:/g,"")}`,x=s.useRef(null),w=s.useRef(null),F=s.useRef({focalX:d,focalY:u,scale:p});F.current={focalX:d,focalY:u,scale:p};const v=l==="image";s.useEffect(()=>{var R;v&&((R=m.current)==null||R.focus({preventScroll:!0}))},[v]);const P=s.useCallback((R,I)=>{var G;const $=(G=m.current)==null?void 0:G.getBoundingClientRect();return!$||$.width<=0||$.height<=0?{x:0,y:0}:{x:(R-$.left)/$.width*t.width,y:(I-$.top)/$.height*t.height}},[t.width,t.height]),M=R=>{var $,G;if(!i)return;R.stopPropagation(),R.preventDefault(),($=m.current)==null||$.focus({preventScroll:!0});const I=Ui(n,i,p);x.current={pointerId:R.pointerId,origin:P(R.clientX,R.clientY),startX:jn(n.width,I.width,d),startY:jn(n.height,I.height,u),width:I.width,height:I.height,moved:!1},(G=m.current)==null||G.setPointerCapture(R.pointerId)},K=(R,I)=>{var q,pe;if(!i)return;R.stopPropagation(),R.preventDefault(),(q=m.current)==null||q.focus({preventScroll:!0});const $=Ui(n,i,p),G=jn(n.width,$.width,d),O=jn(n.height,$.height,u),U={minX:G,minY:O,maxX:G+$.width,maxY:O+$.height},E=Ma(U,Yp(I)),f=Ma(U,I),Q=Math.hypot(f.x-E.x,f.y-E.y);!isFinite(Q)||Q<=0||(w.current={pointerId:R.pointerId,anchor:E,startDistance:Q,startScale:p,startX:G,startY:O,moved:!1},(pe=m.current)==null||pe.setPointerCapture(R.pointerId))},X=R=>{if(!i)return;const I=w.current;if(I&&R.pointerId===I.pointerId){R.stopPropagation(),R.preventDefault();const G=P(R.clientX,R.clientY),O={x:G.x-n.x,y:G.y-n.y},U=Math.hypot(O.x-I.anchor.x,O.y-I.anchor.y),E=Math.min(sl,Math.max(al,I.startScale*(U/I.startDistance)));if(!I.moved&&Math.abs(E-I.startScale)<1e-4)return;I.moved=!0;const f=E/I.startScale,Q=I.anchor.x+(I.startX-I.anchor.x)*f,q=I.anchor.y+(I.startY-I.anchor.y)*f,pe=Ui(n,i,E);y({focalX:vo(n.width,pe.width,Q),focalY:vo(n.height,pe.height,q),scale:E});return}const $=x.current;if($&&R.pointerId===$.pointerId){R.stopPropagation(),R.preventDefault();const G=P(R.clientX,R.clientY),O=G.x-$.origin.x,U=G.y-$.origin.y;if(!$.moved&&O===0&&U===0)return;$.moved=!0,y({focalX:vo(n.width,$.width,$.startX+O),focalY:vo(n.height,$.height,$.startY+U),scale:p})}},j=R=>{var G,O;const I=x.current;if(I&&R.pointerId===I.pointerId){x.current=null,R.stopPropagation(),(G=m.current)!=null&&G.hasPointerCapture(I.pointerId)&&m.current.releasePointerCapture(I.pointerId),I.moved&&S(F.current);return}const $=w.current;$&&R.pointerId===$.pointerId&&(w.current=null,R.stopPropagation(),(O=m.current)!=null&&O.hasPointerCapture($.pointerId)&&m.current.releasePointerCapture($.pointerId),$.moved&&S(F.current))},N=R=>{if(R.key==="Escape"){R.stopPropagation(),c("none");return}if(R.key==="="||R.key==="+"||R.key==="-"||R.key==="_"){R.preventDefault(),R.stopPropagation();const I=R.key==="="||R.key==="+",$=Math.min(sl,Math.max(al,p*(I?au:1/au))),G={focalX:d,focalY:u,scale:$};y(G),S(G)}},_=["nw","ne","se","sw"],T={minX:n.x,minY:n.y,maxX:n.x+n.width,maxY:n.y+n.height},L=s.useMemo(()=>{const R=i??{width:n.width,height:n.height},I=Ui(n,R,p);return!(I.width>0)||!(I.height>0)?null:{x:n.x+jn(n.width,I.width,d),y:n.y+jn(n.height,I.height,u),width:I.width,height:I.height}},[i,n.x,n.y,n.width,n.height,d,u,p]),Y=L?{minX:L.x,minY:L.y,maxX:L.x+L.width,maxY:L.y+L.height}:T;return a.jsxs("svg",{ref:m,className:`${e}-editor${v?` ${e}-editor-armed`:""}`,width:t.width,height:t.height,viewBox:`0 0 ${t.width} ${t.height}`,tabIndex:0,onKeyDown:N,onPointerMove:X,onPointerUp:j,onPointerCancel:j,onLostPointerCapture:j,"data-pretext-image-editor":!0,children:[a.jsx("rect",{className:`${e}-editor-surface`,width:t.width,height:t.height,onPointerDown:()=>c("none")}),v&&o&&L&&r&&a.jsxs(a.Fragment,{children:[a.jsx("defs",{children:a.jsxs("mask",{id:h,maskUnits:"userSpaceOnUse",x:L.x,y:L.y,width:L.width,height:L.height,children:[a.jsx("rect",{x:L.x,y:L.y,width:L.width,height:L.height,fill:"#FFFFFF"}),a.jsx("path",{d:r,fillRule:"evenodd",fill:"#000000"})]})}),a.jsx("image",{className:`${e}-editor-ghost`,href:o??void 0,x:L.x,y:L.y,width:L.width,height:L.height,preserveAspectRatio:"none",mask:`url(#${h})`}),a.jsx("rect",{className:`${e}-editor-image-bounds`,x:L.x,y:L.y,width:L.width,height:L.height})]}),v&&a.jsxs(a.Fragment,{children:[a.jsx("rect",{className:`${e}-editor-bbox`,x:n.x,y:n.y,width:n.width,height:n.height}),a.jsx("rect",{className:`${e}-editor-body`,x:n.x,y:n.y,width:n.width,height:n.height,onPointerDown:M}),_.map(R=>{const I=ll(Y,R),$=R==="ne"||R==="sw";return a.jsxs("g",{children:[a.jsx("rect",{className:`${e}-editor-scale`,x:I.x-ia/2,y:I.y-ia/2,width:ia,height:ia}),a.jsx("rect",{className:`${e}-editor-scale-grab${$?` ${e}-editor-scale-grab-nesw`:""}`,x:I.x-na/2,y:I.y-na/2,width:na,height:na,onPointerDown:G=>K(G,R)})]},R)})]})]})}const ul=10,fT=ul*2,zn=7,yT=4,lo=9,vT=3.5,su=1.08,xT=.05,oa=14,bT=1,ra=14,aa=8;function ST({P:e,box:t,viewBox:n,contours:i,snap:o,stretchToBox:r,uniformStretch:l=!1,stage:c,onStageChange:d,onSelectionChange:u,onChange:p,onCommit:y}){const S=s.useRef(null),m=s.useRef(null),h=s.useRef(i);h.current=i;const x=s.useRef(null),w=s.useRef(null),F=s.useRef(null),v=s.useRef(null),[P,M]=s.useState([]),[K,X]=s.useState(yo),[j,N]=s.useState(null),_=s.useCallback(g=>{X(Z=>KC(Z,g)?Z:g)},[]),T=c==="shape";s.useEffect(()=>{var g;T&&((g=S.current)==null||g.focus({preventScroll:!0}))},[T]),s.useEffect(()=>{T||M(g=>g.length?[]:g)},[T]);const L=P.length>0;s.useEffect(()=>{u==null||u(L)},[L,u]),s.useEffect(()=>()=>u==null?void 0:u(!1),[u]);const Y=n.width>0?t.width/n.width:1,R=n.height>0?t.height/n.height:1,I=Math.min(Y,R),$=r&&l?I:Y,G=r&&l?I:R,O=r&&l?(t.width-n.width*I)/2:0,U=r&&l?(t.height-n.height*I)/2:0,E=s.useCallback(g=>r?{x:O+(g.x-n.x)*$,y:U+(g.y-n.y)*G}:{x:g.x-n.x,y:g.y-n.y},[r,n,$,G,O,U]),f=s.useCallback(g=>r?{x:n.x+($>0?(g.x-O)/$:0),y:n.y+(G>0?(g.y-U)/G:0)}:{x:n.x+g.x,y:n.y+g.y},[r,n,$,G,O,U]),Q=s.useMemo(()=>f({x:t.width/2,y:t.height/2}),[f,t.width,t.height]),q=s.useCallback((g,Z)=>{var re;const J=(re=S.current)==null?void 0:re.getBoundingClientRect();if(!J||J.width<=0||J.height<=0)return{x:0,y:0};if(r){const he=(g-J.left)/J.width*t.width,z=(Z-J.top)/J.height*t.height;return{x:n.x+($>0?(he-O)/$:0),y:n.y+(G>0?(z-U)/G:0)}}return{x:n.x+(g-J.left),y:n.y+(Z-J.top)}},[r,n,t.width,t.height,$,G,O,U]),pe=s.useCallback((g,Z)=>{var re;const J=(re=S.current)==null?void 0:re.getBoundingClientRect();return!J||J.width<=0||J.height<=0?{x:0,y:0}:{x:(g-J.left)/J.width*t.width,y:(Z-J.top)/J.height*t.height}},[t.width,t.height]),k=s.useCallback((g,Z)=>{const J=l&&!(Z!=null&&Z.preserveShape)?DC(g,n,t,O,U,$,G):g;y(J,Z)},[y,l,n,t,O,U,$,G]),me=s.useCallback(()=>{N(null)},[]),C=s.useCallback((g,Z,J)=>{if(!J||x.current||w.current||F.current||v.current){me();return}const re=pe(g,Z),he=un(h.current,E);for(const H of he)for(const be of H.nodes)if(Math.hypot(be.p.x-re.x,be.p.y-re.y)<=lo){me();return}const z=Yd(he,re);if(!z||z.distance>ul){me();return}const B=he[z.contour],ne=B==null?void 0:B.nodes[z.segment],ce=B==null?void 0:B.nodes[(z.segment+1)%((B==null?void 0:B.nodes.length)??1)],ee=!!(ne&&ce&&!Vo(ne,ce));N(H=>H&&H.curved===ee&&Math.hypot(H.point.x-z.point.x,H.point.y-z.point.y)<.25?H:{point:z.point,curved:ee})},[pe,E,me]),ue=g=>{var ze;const Z=g.metaKey||g.ctrlKey,J=F.current;if(J&&g.pointerId===J.pointerId){if(g.stopPropagation(),g.preventDefault(),J.startDistance<=0)return;const Xe=q(g.clientX,g.clientY),Ue=Math.hypot(Xe.x-J.origin.x,Xe.y-J.origin.y),Qe=Math.max(xT,Ue/J.startDistance);if(!J.moved&&Math.abs(Qe-1)<1e-4)return;J.moved=!0,p(Xd(J.startContours,J.origin,Qe));return}const re=w.current;if(re&&g.pointerId===re.pointerId){g.stopPropagation(),g.preventDefault();const Xe=q(g.clientX,g.clientY),{bbox:Ue}=re,Qe=Ue.maxX-Ue.minX,We=Ue.maxY-Ue.minY,it=Xe.x-re.origin.x,ye=Xe.y-re.origin.y;let Te=it,Ve=ye;if(isFinite(Qe)&&isFinite(We))if(r){let et=n.x,at=n.x+n.width,tt=n.y,Ye=n.y+n.height;l&&($>0&&(et=n.x+(0-O)/$,at=n.x+(t.width-O)/$),G>0&&(tt=n.y+(0-U)/G,Ye=n.y+(t.height-U)/G));const xt=Math.min(et,at-Qe),pt=Math.max(et,at-Qe),De=Math.min(tt,Ye-We),_e=Math.max(tt,Ye-We),He=Math.min(pt,Math.max(xt,Ue.minX+it)),Ae=Math.min(_e,Math.max(De,Ue.minY+ye));Te=He-Ue.minX,Ve=Ae-Ue.minY}else{const et=Ue.minX-n.x,at=Ue.minY-n.y,tt=Math.min(0,t.width-Qe),Ye=Math.max(0,t.width-Qe),xt=Math.min(0,t.height-We),pt=Math.max(0,t.height-We),De=Math.min(Ye,Math.max(tt,et+it)),_e=Math.min(pt,Math.max(xt,at+ye));Te=De-et,Ve=_e-at}const Ze=[];if(!Z&&isFinite(Qe)&&isFinite(We)){const et=E({x:Ue.minX+Qe/2+Te,y:Ue.minY+We/2+Ve}),at={x:t.width/2,y:t.height/2};Math.abs(et.x-at.x)<=oa&&(Te=Q.x-Ue.minX-Qe/2,Ze.push(rl(at.x,"x",t))),Math.abs(et.y-at.y)<=oa&&(Ve=Q.y-Ue.minY-We/2,Ze.push(rl(at.y,"y",t)))}if(!re.moved&&Te===0&&Ve===0)return;re.moved=!0,_(Ze.length?Ze:yo),p(un(re.startContours,et=>({x:et.x+Te,y:et.y+Ve})),{carryImage:!0});return}const he=v.current;if(he&&g.pointerId===he.pointerId){g.stopPropagation(),g.preventDefault();const Xe=q(g.clientX,g.clientY);let Ue=Xe.x-he.origin.x,Qe=Xe.y-he.origin.y;if(g.shiftKey&&(Math.abs(Ue)>Math.abs(Qe)?Qe=0:Ue=0),!he.moved&&Ue===0&&Qe===0)return;he.moved=!0,p(qd(he.startContours,he.selection,Ue,Qe));return}const z=x.current;if(!z||g.pointerId!==z.pointerId){C(g.clientX,g.clientY,P.length>0||T);return}me(),g.stopPropagation(),g.preventDefault();const B=q(g.clientX,g.clientY);if(z.kind==="anchor"){const Xe={x:z.anchor.x+(B.x-z.origin.x),y:z.anchor.y+(B.y-z.origin.y)},Ue=Z?[]:qC(h.current,{contour:z.contour,node:z.node}),Qe=Z||!z.center?[]:[z.center],We=Zd(Qd(Ue,Qe.map(Te=>Te.x),"x"),Xe,"x",E,oa),it=Zd(Qd(Ue,Qe.map(Te=>Te.y),"y"),Xe,"y",E,oa),ye=Z?Xe:{x:(We==null?void 0:We.value)??ta(Xe.x,o),y:(it==null?void 0:it.value)??ta(Xe.y,o)};if(g.shiftKey&&(Math.abs(ye.x-z.anchor.x)>Math.abs(ye.y-z.anchor.y)?ye.y=z.anchor.y:ye.x=z.anchor.x),!z.moved&&ye.x===z.anchor.x&&ye.y===z.anchor.y)return;z.moved=!0,_(ZC(ye,We,it,t,E)),p(BC(h.current,z.contour,z.node,ye));return}const ne=(ze=h.current[z.contour])==null?void 0:ze.nodes[z.node],ce=z.mirror&&!g.altKey,ee=ce||Z?null:z.kind==="in"?ne==null?void 0:ne.out:ne==null?void 0:ne.in,H=ne?E(ne.p):null,be=ee?E(ee):null,ae=ne&&(!Z||g.shiftKey)?eT(B,ne.p,ce||Z?null:JC(h.current[z.contour],z.node,z.kind,E),H&&be?Math.hypot(be.x-H.x,be.y-H.y):null,g.shiftKey,E,f):{point:B,guides:yo},W=ae.guides.length?ae.point:Z?B:{x:ta(B.x,o),y:ta(B.y,o)},ke=z.kind==="in"?ne==null?void 0:ne.in:ne==null?void 0:ne.out;!z.moved&&ke&&W.x===ke.x&&W.y===ke.y||(z.moved=!0,_(ae.guides),p(VC(h.current,z.contour,z.node,z.kind,W,ce)))},te=g=>{_(yo);const Z=F.current;if(Z&&g.pointerId===Z.pointerId){F.current=null,g.stopPropagation();const ee=S.current;ee!=null&&ee.hasPointerCapture(Z.pointerId)&&ee.releasePointerCapture(Z.pointerId),Z.moved&&k(h.current,{preserveShape:!0});return}const J=w.current;if(J&&g.pointerId===J.pointerId){w.current=null,g.stopPropagation();const ee=S.current;ee!=null&&ee.hasPointerCapture(J.pointerId)&&ee.releasePointerCapture(J.pointerId),J.moved?k(h.current,{preserveShape:!0}):M([]);return}const re=v.current;if(re&&g.pointerId===re.pointerId){v.current=null,g.stopPropagation();const ee=S.current;ee!=null&&ee.hasPointerCapture(re.pointerId)&&ee.releasePointerCapture(re.pointerId),re.moved&&k(h.current);return}const he=x.current;if(!he||g.pointerId!==he.pointerId)return;x.current=null,g.stopPropagation();const z=S.current;z!=null&&z.hasPointerCapture(he.pointerId)&&z.releasePointerCapture(he.pointerId);const B=Math.hypot(g.clientX-he.clientOrigin.x,g.clientY-he.clientOrigin.y);if(he.moved||B>yT){he.moved&&k(h.current);return}if(!he.toggleOnRelease||g.type!=="pointerup")return;const ce=Kd(h.current,he.contour,he.node);ce!==h.current&&(p(ce),k(ce))},fe=g=>{g.stopPropagation()},Pe=g=>{var Z,J;g.stopPropagation(),g.preventDefault(),me(),(Z=S.current)==null||Z.focus({preventScroll:!0}),w.current={pointerId:g.pointerId,origin:q(g.clientX,g.clientY),startContours:Vn(i),bbox:Li(i),moved:!1},(J=S.current)==null||J.setPointerCapture(g.pointerId)},de=(g,Z)=>{var B,ne;g.stopPropagation(),g.preventDefault(),me(),(B=S.current)==null||B.focus({preventScroll:!0}),M([]),d("shape");const J=Li(i),re=Ma(J,Yp(Z)),he=ll(J,Z),z=Math.hypot(he.x-re.x,he.y-re.y);!isFinite(z)||z<=0||(F.current={pointerId:g.pointerId,corner:Z,origin:re,startDistance:z,startContours:Vn(i),moved:!1},(ne=S.current)==null||ne.setPointerCapture(g.pointerId))},we=(g,Z,J,re)=>{var B,ne,ce,ee;g.stopPropagation(),g.preventDefault(),me(),(B=S.current)==null||B.focus({preventScroll:!0});const he=(ne=i[J])==null?void 0:ne.nodes[re];if(!he)return;if(g.altKey){const H=Z==="anchor"?Kp(i,J,re):GC(i,J,re,Z);if(H===i)return;M(Z==="anchor"?[]:[{contour:J,node:re}]),p(H),k(H);return}const z=g.metaKey||g.ctrlKey;if(Z==="anchor"&&g.shiftKey&&!z){M(H=>H.some(be=>be.contour===J&&be.node===re)?H.filter(be=>!(be.contour===J&&be.node===re)):[...H,{contour:J,node:re}]);return}if(Z==="anchor"&&!z&&P.length>1&&P.some(H=>H.contour===J&&H.node===re)){v.current={pointerId:g.pointerId,origin:q(g.clientX,g.clientY),startContours:Vn(i),selection:P,moved:!1},(ce=S.current)==null||ce.setPointerCapture(g.pointerId);return}M([{contour:J,node:re}]),x.current={kind:Z,contour:J,node:re,pointerId:g.pointerId,origin:q(g.clientX,g.clientY),clientOrigin:{x:g.clientX,y:g.clientY},anchor:he.p,center:OC(i),mirror:Z!=="anchor"&&!!(he.in&&he.out),toggleOnRelease:z,moved:!1},(ee=S.current)==null||ee.setPointerCapture(g.pointerId)},V=g=>{g.stopPropagation(),g.preventDefault(),me();const Z=un(i,E),J=Yd(Z,pe(g.clientX,g.clientY));if(!J||J.distance>ul)return;const{contours:re,nodeIndex:he}=XC(i,J.contour,J.segment,J.t);he<0||(M([{contour:J.contour,node:he}]),p(re),k(re))},ie=g=>{if(g.key==="="||g.key==="+"||g.key==="-"||g.key==="_"){g.preventDefault(),g.stopPropagation();const z=Li(i);if(!isFinite(z.minX)||!isFinite(z.maxX))return;const B={x:(z.minX+z.maxX)/2,y:(z.minY+z.maxY)/2},ce=g.key==="="||g.key==="+"?su:1/su,ee=Xd(i,B,ce);p(ee),k(ee,{preserveShape:!0});return}if(g.key==="Escape"){g.stopPropagation(),M([]),d("none");return}if(!P.length)return;if(g.key==="Backspace"||g.key==="Delete"){g.preventDefault(),g.stopPropagation();const z=jC(i,P);if(z===i)return;M([]),p(z),k(z);return}const Z=o>0?o:bT,J=g.shiftKey?Z*10:Z,re={ArrowLeft:[-J,0],ArrowRight:[J,0],ArrowUp:[0,-J],ArrowDown:[0,J]}[g.key];if(!re)return;g.preventDefault(),g.stopPropagation();const he=qd(i,P,re[0],re[1]);p(he),k(he)},oe=s.useMemo(()=>Ho(un(i,E)),[i,E]),le=s.useMemo(()=>Li(i),[i]),ve=E({x:le.minX,y:le.minY}),Fe={width:E({x:le.maxX,y:le.minY}).x-ve.x,height:E({x:le.minX,y:le.maxY}).y-ve.y},Ee=T&&P.length===0&&isFinite(le.minX)&&isFinite(le.maxX)&&le.maxX>le.minX&&le.maxY>le.minY,Ce=P.length>0||T,Se=Ce;return a.jsxs("svg",{ref:S,className:`${e}-editor${Ce?` ${e}-editor-armed`:""}`,width:t.width,height:t.height,viewBox:`0 0 ${t.width} ${t.height}`,tabIndex:0,onKeyDown:ie,onPointerDown:()=>{var g;return(g=S.current)==null?void 0:g.focus({preventScroll:!0})},onPointerMove:ue,onPointerLeave:me,onPointerUp:te,onPointerCancel:te,onLostPointerCapture:te,onContextMenu:g=>{g.preventDefault()},"data-pretext-path-editor":!0,"data-selection":"none",children:[a.jsx("rect",{className:`${e}-editor-surface`,width:t.width,height:t.height,onPointerDown:()=>{M([]),d("none")},onClick:V}),Se&&a.jsx("path",{className:`${e}-editor-outline`,d:oe}),Se&&K.map((g,Z)=>a.jsx("line",{className:`${e}-editor-snap ${e}-editor-snap-${g.kind}`,x1:g.a.x,y1:g.a.y,x2:g.b.x,y2:g.b.y},`${g.kind}-${Z}`)),a.jsx("path",{ref:m,className:`${e}-editor-body`,d:oe,fillRule:"evenodd",onPointerDown:Pe,onClick:V}),Se&&a.jsx("path",{className:`${e}-editor-hit`,d:oe,style:{strokeWidth:fT},onClick:V}),Se&&j&&a.jsx("rect",{className:`${e}-editor-add-preview`,x:j.point.x-zn/2,y:j.point.y-zn/2,width:zn,height:zn,rx:j.curved?zn/2:0}),Se&&i.map((g,Z)=>g.nodes.map((J,re)=>{const he=P.some(B=>B.contour===Z&&B.node===re),z=E(J.p);return a.jsxs("g",{children:[he&&P.length===1&&["in","out"].map(B=>{const ne=J[B];if(!ne)return null;const ce=E(ne);return a.jsxs("g",{children:[a.jsx("line",{className:`${e}-editor-handle-line`,x1:z.x,y1:z.y,x2:ce.x,y2:ce.y}),a.jsx("circle",{className:`${e}-editor-handle`,cx:ce.x,cy:ce.y,r:vT}),a.jsx("circle",{className:`${e}-editor-grab`,cx:ce.x,cy:ce.y,r:lo,onPointerDown:ee=>we(ee,B,Z,re),onClick:fe})]},B)}),a.jsx("rect",{className:`${e}-editor-anchor${he?` ${e}-editor-anchor-selected`:""}`,x:z.x-zn/2,y:z.y-zn/2,width:zn,height:zn,rx:jp(J)?zn/2:0}),a.jsx("rect",{className:`${e}-editor-grab`,x:z.x-lo,y:z.y-lo,width:lo*2,height:lo*2,onPointerDown:B=>we(B,"anchor",Z,re),onClick:fe,onDoubleClick:B=>{B.stopPropagation(),B.preventDefault();const ne=Kd(i,Z,re);p(ne),k(ne)}})]},`${Z}-${re}`)})),Ee&&a.jsxs("g",{children:[a.jsx("rect",{className:`${e}-editor-bbox`,x:ve.x,y:ve.y,width:Fe.width,height:Fe.height}),["nw","ne","se","sw"].map(g=>{const Z=E(ll(le,g)),J=g==="ne"||g==="sw";return a.jsxs("g",{children:[a.jsx("rect",{className:`${e}-editor-scale`,x:Z.x-aa/2,y:Z.y-aa/2,width:aa,height:aa}),a.jsx("rect",{className:`${e}-editor-scale-grab${J?` ${e}-editor-scale-grab-nesw`:""}`,x:Z.x-ra/2,y:Z.y-ra/2,width:ra,height:ra,onPointerDown:re=>de(re,g),onClick:fe})]},g)})]})]})}const wT=4e3,$T=/^(?:https?:|mailto:|tel:)/i;function Qp(e){return!!e&&typeof e=="object"&&e.type==="link"}function CT(e){if(!e)return;const t=e.replace(/\s+/g,"");if(!(/^[a-z][a-z0-9+.-]*:/i.test(t)&&!$T.test(t)))return t}function TT(e){const t=[];return e.forEach((n,i)=>{const o=(r,l,c)=>{for(const d of r){if(Qp(d)){o(d.children??[],CT(d.value),d.target);continue}const u=d,p=(u==null?void 0:u.text)??"";if(p.trim())for(const y of p.split(/\s+/))y&&t.push({text:y,leaf:u,href:l,target:c,para:i})}};o((n==null?void 0:n.children)??[])}),t}function lu(e){return{...e.fontFamily&&{fontFamily:zo(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 IT(e){return e.map(t=>{const n=[],i=o=>{for(const r of o){if(Qp(r)){i(r.children??[]);continue}n.push((r==null?void 0:r.text)??"")}};return i((t==null?void 0:t.children)??[]),n.join("")})}function LT(e,t,n,i,o){if(t<=0||!e.length||n<=0||i<=0)return e;const r=o==="avoid"?1:-1;return e.map(l=>{if(!l.length)return l;let c=1/0,d=-1/0,u=1/0,p=-1/0;for(const m of l){const h=m.x*n,x=m.y*i;h<c&&(c=h),h>d&&(d=h),x<u&&(u=x),x>p&&(p=x)}const y=(c+d)/2,S=(u+p)/2;return l.map(m=>{const h=m.x*n,x=m.y*i,w=h-y,F=x-S,v=Math.sqrt(w*w+F*F);if(v<1e-6)return m;const M=Math.max(0,v+r*t)/v;return{x:(y+w*M)/n,y:(S+F*M)/i}})})}const PT=.75;function cu(e,t,n,i,o,r){if(e.kind==="fragment"||!t)return null;const l=e.token.text,c=e.offset>0?t[e.offset-1]:0,d=n?n.map(u=>u-e.offset).filter(u=>u>=(e.offset>0?2:1)&&u<l.length):Array.from({length:l.length-1},(u,p)=>p+1);for(let u=d.length-1;u>=0;u-=1){const p=d[u];if(e.offset+p>t.length)continue;const y=!!n&&l[p-1]!=="-",S=t[e.offset+p-1]-c,m=S+(y?r:0);if(!(m*o>i))return{chars:p,fragmentText:y?`${l.slice(0,p)}-`:l.slice(0,p),remainderText:l.slice(p),fragmentWidth:m,remainderWidth:Math.max(0,e.width-S)}}return null}function du(e){const{tokens:t,widths:n,rings:i,mode:o,align:r,scale:l,width:c,height:d,allowOverflow:u,capInset:p,capLines:y}=e,S=!!e.hyphenate,m=e.charWidths??[],h=e.hyphenPoints??[],x=e.hyphenWidth??0,w=e.lineHeight*l,F=e.spaceWidth*l,v=Math.max(0,e.shapeMargin??0),P=[],M=t.map((E,f)=>({token:E,originalIndex:f,width:n[f],kind:"whole",offset:0}));if(!M.length||c<=0||w<=0)return{segments:P,placed:0,height:0,capLeft:0,capTop:0,renderTokens:t};const K=Math.max(1,F*.5),X=w*vC,j=LT(i,v,c,d,o),N=Math.max(1,Math.floor(e.columns??1)),_=N>1?Math.max(0,e.columnGap??0):0,T=(c-_*(N-1))/N;let L=0,Y=0,R=0,I=0,$=0,G=null;const O=(E,f,Q)=>IC(j,(E+X)/d,(E+w-X)/d,o).map(q=>({x0:Math.max(f,q.x0*c),x1:Math.min(Q,q.x1*c)})).filter(q=>q.x1>q.x0);for(let E=0;E<N&&L<M.length&&T>0;E+=1){const f=E*(T+_),Q=f+T,q=u&&E===N-1;let pe=0;for(let C=0;C+w<=d;C+=w)for(const ue of O(C,f,Q))pe=Math.max(pe,ue.x1-ue.x0);let k=M[L].token.para,me=0;for(;L<M.length&&R<wT;){const C=me+w>d;if(C&&!q)break;const ue=M[L].token.para;if(ue>k+1){me+=w*(ue-k-1),k=ue-1,R+=1;continue}let te=C?[{x0:f,x1:Q}]:O(me,f,Q);p>0&&y>0&&E===0&&!C&&te.length&&(G===null&&(G=R,I=te[0].x0,$=me),R-G<y&&(te=TC(te,{x0:I,x1:I+p})));const fe=te.reduce((Pe,de)=>Math.max(Pe,de.x1-de.x0),0);for(const Pe of te){const de=Pe.x1-Pe.x0;if(de<K)continue;if(L>=M.length||M[L].token.para!==ue)break;const we=L;let V=0;for(;L<M.length&&M[L].token.para===ue;){const ie=M[L],oe=L===we,le=ie.width*l,ve=oe?le:F+le;if(V+ve<=de){V+=ve,L+=1;continue}const Fe=de-V-(oe?0:F),Ee=oe&&le>T-.5,Ce=de>=fe-.5&&de>=pe*PT,Se=m[ie.originalIndex],g=h[ie.originalIndex],Z=(S&&g?cu(ie,Se,g,Fe,l,x):null)??(Ee&&Ce?cu(ie,Se,void 0,Fe,l,x):null);if(Z){const J={token:{...ie.token,text:Z.fragmentText},originalIndex:ie.originalIndex,width:Z.fragmentWidth,kind:"fragment",offset:ie.offset},re={token:{...ie.token,text:Z.remainderText},originalIndex:ie.originalIndex,width:Z.remainderWidth,kind:"remainder",offset:ie.offset+Z.chars};M.splice(L,1,J,re),V+=(oe?0:F)+Z.fragmentWidth*l,L+=1;break}if(Ee&&N===1&&de>=pe-.5){V+=ve,L+=1;continue}break}if(L>we){const ie=L>=M.length||M[L].token.para!==ue;P.push({top:me,left:Pe.x0,width:de,from:we,to:L,justify:r==="justify"&&!ie})}if(L>=M.length||M[L].token.para!==ue)break}k=ue,me+=w,R+=1}Y=Math.max(Y,me)}let U=0;if(L>0){const E=M[L-1];U=E.kind==="fragment"?E.originalIndex:E.originalIndex+1}return{segments:P,placed:U,height:P.length?Y:0,capLeft:I,capTop:$,renderTokens:M.map(E=>E.token)}}const MT=.12,ET=2,RT=10,Fs=.25,kT=e=>{const t=e.getBoundingClientRect();return{top:t.top,left:t.left,width:t.width,height:t.height}},AT=(e,t)=>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,FT=(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=kT(e);(!r||!AT(r,c))&&(r=c,i(c)),o=requestAnimationFrame(l)};return l(),()=>cancelAnimationFrame(o)},[e,t]),n},Ns=(e,t)=>{if(!(t.width>0)||!(t.height>0))return e;const n=Math.min(t.width,t.height),i=(t.width-n)/2,o=(t.height-n)/2;return e.map(r=>r.map(l=>({x:(i+l.x*n)/t.width,y:(o+l.y*n)/t.height})))},nr=typeof window>"u"?s.useEffect:s.useLayoutEffect;function NT(){return typeof document>"u"?null:document.body}function _T({P:e,item:t,shape:n,customPath:i,pathFit:o,viewBox:r,mode:l,align:c,allowOverflow:d,fitEnabled:u,scale:p,onFitScale:y,padding:S,columns:m,gutter:h,hyphenate:x,showOverflowIndicator:w,dropCapLines:F,dropCapSize:v,showGuides:P,typography:M,imageUrl:K,imageFocalX:X,imageFocalY:j,imageScale:N,imageCustomPath:_,imagePathEdited:T,pathDragActive:L,pathCarryImage:Y,onCarryImageConsumed:R,pathEditor:I,imageEditor:$}){var Vt,Zt;const G=`pretext-shape-image-${s.useId().replace(/:/g,"")}`,[O,U]=s.useState(null),E=s.useRef(null),[f,Q]=s.useState({width:0,height:0}),[q,pe]=s.useState(0),[k,me]=s.useState(0),[C,ue]=s.useState(null),[te,fe]=s.useState(0),[Pe,de]=s.useState("none");s.useEffect(()=>{!I&&!$&&de("none")},[I,$]);const[we,V]=s.useState(null);s.useEffect(()=>{if(!K||typeof Image>"u"){V(null);return}let $e=!1;const Ge=new Image;return Ge.onload=()=>{$e||V({width:Ge.naturalWidth,height:Ge.naturalHeight})},Ge.src=K,()=>{$e=!0}},[K]);const ie=s.useMemo(()=>Array.isArray(t==null?void 0:t.text)?t.text:[],[t]),oe=s.useMemo(()=>TT(ie),[ie]),le=s.useMemo(()=>IT(ie),[ie]),ve=s.useMemo(()=>le.join(`
|
|
27899
|
+
`),[le]),{lang:Fe,hyphenateSync:Ee}=mT(x,ve),Ce=s.useMemo(()=>x?oe.map($e=>gT($e.text,Ee)):[],[x,oe,Ee]),Se=F>0&&v>1?((Zt=(Vt=oe[0])==null?void 0:Vt.text)==null?void 0:Zt.charAt(0))??"":"",g=(I==null?void 0:I.contours)??null,Z=s.useMemo(()=>{let $e=[];if(g){const Ge=$r(g);Ge.length&&($e=$o(Ge,r))}if(!$e.length){const Ge=i.trim(),ft=Ge?Bd(Ge,o,r):null;ft&&ft.length?$e=ft:$e=tl(n==="custom"?"rectangle":n)}return n==="circle"?Ns($e,f):$e},[g,n,i,o,r,f.width,f.height]),J=I==null?void 0:I.onConvert,re=(I==null?void 0:I.needsConversion)??!1,he=s.useMemo(()=>{if(n==="circle")return!1;const $e=g??(i.trim()?ki(i):null);return!!($e&&Up($e,r))},[g,i,r,n]),[z,B]=s.useState(null);nr(()=>{if(!he){z&&B(null);return}!z&&f.width>0&&f.height>0&&B({width:f.width,height:f.height})},[he,f.width,f.height,z]);const ne=s.useMemo(()=>{if(!he||f.width<=0||f.height<=0)return Z;const $e=z??f,Ge=r.width/$e.width,ft=r.height/$e.height;return Z.map(Lt=>Lt.map(wt=>({x:wt.x*Ge,y:wt.y*ft})))},[Z,he,z,r.width,r.height,f.width,f.height]),ce=s.useMemo(()=>{if(g){const Lt=$r(g);if(Lt.length){const wt=$o(Lt,r);return n==="circle"?Ns(wt,f):wt}}const $e=_.trim(),Ge=$e?Bd($e,o,r):null,ft=Ge&&Ge.length?Ge:tl(n==="custom"?"rectangle":n);return n==="circle"?Ns(ft,f):ft},[g,n,_,o,r,f.width,f.height]),ee=s.useMemo(()=>{if(!he||f.width<=0||f.height<=0)return ce;const $e=z??f,Ge=r.width/$e.width,ft=r.height/$e.height;return ce.map(Lt=>Lt.map(wt=>({x:wt.x*Ge,y:wt.y*ft})))},[ce,he,z,r.width,r.height,f.width,f.height]),H=s.useRef(null),be=s.useRef(!1);s.useEffect(()=>{if(!(!J||f.width<=0||f.height<=0)){if(he){if(H.current===i)return;const $e=g??(i.trim()?ki(i):null);if(!($e!=null&&$e.length))return;const Ge=un($e,ft=>({x:r.x+(ft.x-r.x)/f.width*r.width,y:r.y+(ft.y-r.y)/f.height*r.height}));H.current=Ho(Ge),J(Ge);return}!re||!Z.length||be.current||(be.current=!0,J(un(Xp(Z),$e=>({x:$e.x*Pa,y:$e.y*Pa}))))}},[re,he,J,Z,g,i,r,f.width,f.height]);const ae=s.useCallback(()=>{const $e=O;if(!$e)return;const Ge=$e.getBoundingClientRect(),ft=window.getComputedStyle($e),Lt=parseFloat(ft.paddingTop)||0;pe(Nt=>Math.abs(Nt-Lt)<.5?Nt:Lt);const wt=parseFloat(ft.columnGap)||0;me(Nt=>Math.abs(Nt-wt)<.5?Nt:wt);const vt={width:Ge.width,height:Ge.height};Q(Nt=>Math.abs(Nt.width-vt.width)<.5&&Math.abs(Nt.height-vt.height)<.5?Nt:vt)},[O]);nr(()=>{const $e=O;if(!$e||typeof ResizeObserver>"u")return;ae();const Ge=new ResizeObserver(ae);return Ge.observe($e),()=>Ge.disconnect()},[O,ae]),nr(()=>{ae()},[S,h,ae]),s.useEffect(()=>{const $e=typeof document<"u"?document.fonts:void 0;$e!=null&&$e.ready&&$e.ready.then(()=>{fe(Ge=>Ge+1)})},[]),nr(()=>{const $e=E.current;if(!$e)return;if(!oe.length){ue(null);return}const Ge=[],ft=document.createDocumentFragment();for(const $t of oe){const _t=document.createElement("span");Object.assign(_t.style,lu($t.leaf)),_t.textContent=$t.text,ft.appendChild(_t),Ge.push(_t)}const Lt=document.createElement("span");Lt.textContent=" ",ft.appendChild(Lt);const wt=document.createElement("span");wt.textContent="-",ft.appendChild(wt);const vt=Se||"H",Nt=document.createElement("span");Nt.textContent=vt,Nt.style.lineHeight="1",ft.appendChild(Nt),$e.replaceChildren(ft);const Wt=window.getComputedStyle($e),Dt=parseFloat(Wt.fontSize)||16,Me=parseFloat(Wt.lineHeight),ct=Number.isNaN(Me)?Dt*1.2:Me,dt=Math.max(ct,Dt),kt=document.createElement("span");kt.textContent=vt,kt.style.lineHeight=`${dt}px`;const Ke=document.createElement("span");Ke.style.cssText="display:inline-block;width:0;height:0;vertical-align:baseline",kt.appendChild(Ke),$e.appendChild(kt);const st=kt.getBoundingClientRect().top,It=Ke.getBoundingClientRect().top,At=Math.max(1,It-st);kt.remove();let ut=At*.8;const Ut=document.createElement("canvas").getContext("2d"),Ot=$t=>`${Wt.fontStyle} ${Wt.fontWeight} ${$t}px ${Wt.fontFamily}`;if(Ut){Ut.font=Ot(Dt);const $t=Ut.measureText(vt).actualBoundingBoxAscent;$t>0&&(ut=$t)}const Bt=v>1?(v-1)*dt+ut:ut;let Xt=Dt*(Bt/ut);if(Ut){Ut.font=Ot(Xt);const $t=Ut.measureText(vt).actualBoundingBoxAscent;$t>0&&(Xt=Xt*(Bt/$t))}Nt.style.fontSize=`${Xt}px`,Nt.style.lineHeight=`${Xt}px`;const zt=document.createElement("span");zt.style.cssText="display:inline-block;width:0;height:0;vertical-align:baseline",Nt.appendChild(zt);const Kt=Math.max(1,zt.getBoundingClientRect().top-Nt.getBoundingClientRect().top);zt.remove();const Le=(v-1)*dt+At-Kt,Ne=Ge.map($t=>$t.getBoundingClientRect().width),Oe=Lt.getBoundingClientRect().width,yt=wt.getBoundingClientRect().width,Tt=Se?Nt.getBoundingClientRect().width:0,Je=(f.width-k*(m-1))/m,Pt=Ge.map(($t,_t)=>{var pi;const on=$t.firstChild;if(!(on instanceof Text)||on.data.length<2||!(Ne[_t]>Je-.5)&&!((pi=Ce[_t])!=null&&pi.length))return;const bn=document.createRange(),ui=$t.getBoundingClientRect().left,dn=[];for(let Yn=1;Yn<=on.data.length;Yn+=1)bn.setStart(on,0),bn.setEnd(on,Yn),dn.push(bn.getBoundingClientRect().right-ui);return dn});$e.replaceChildren(),ue({widths:Ne,spaceWidth:Oe,dashWidth:yt,charWidths:Pt,lineHeight:dt,capWidth:Tt,dropCapFontSize:Xt,dropCapTopAdjust:Le})},[oe,M,Se,F,v,te,f.width,x,Ce,m,k]);const W=C&&Se?C.capWidth+C.lineHeight*MT:0,ke=Math.max(F,Math.ceil(v)),ze=s.useMemo(()=>{if(!C||!oe.length||f.width<=0||f.height<=0||!u)return 1;const $e=Lt=>du({tokens:oe,widths:C.widths,spaceWidth:C.spaceWidth,lineHeight:C.lineHeight,width:f.width,height:f.height,rings:ne,mode:l,align:c,scale:Lt,allowOverflow:!1,capInset:W*Lt,capLines:Se?ke:0,hyphenate:x,charWidths:C.charWidths,hyphenPoints:Ce,hyphenWidth:C.dashWidth,shapeMargin:q,columns:m,columnGap:k});if($e(1).placed>=oe.length)return 1;if($e(Fs).placed<oe.length)return Fs;let Ge=Fs,ft=1;for(let Lt=0;Lt<RT;Lt+=1){const wt=(Ge+ft)/2;$e(wt).placed>=oe.length?Ge=wt:ft=wt}return Ge},[C,oe,f.width,f.height,ne,l,c,u,W,Se,ke,x,Ce,q,m,k]);s.useEffect(()=>{y(ze)},[ze,y]);const Xe=u?Math.min(p,ze):1,Ue=s.useMemo(()=>!C||!oe.length||f.width<=0||f.height<=0?{segments:[],placed:0,height:0,capLeft:0,capTop:0,renderTokens:oe}:du({tokens:oe,widths:C.widths,spaceWidth:C.spaceWidth,lineHeight:C.lineHeight,width:f.width,height:f.height,rings:ne,mode:l,align:c,scale:Xe,allowOverflow:d,capInset:W*Xe,capLines:Se?ke:0,hyphenate:x,charWidths:C.charWidths,hyphenPoints:Ce,hyphenWidth:C.dashWidth,shapeMargin:q,columns:m,columnGap:k}),[C,oe,f.width,f.height,ne,l,c,Xe,d,W,Se,ke,x,Ce,q,m,k]),Qe=w&&oe.length>0&&Ue.placed<oe.length,We=C?C.dropCapFontSize*Xe:0,it=C?C.dropCapTopAdjust*Xe:0,ye=c==="justify"?"left":c,Te=C?C.lineHeight*Xe:0,Ve=Ue.segments.length?Ue.segments[Ue.segments.length-1]:null,Ze=Ve?{top:Ve.top+Te,left:Ve.left+Ve.width/2}:{top:f.height,left:f.width/2},et=!!(I&&g&&f.width>0&&f.height>0),at=!!$,tt=(et||at)&&f.width>0&&f.height>0,Ye=FT(O,tt),xt=tt&&Ye?NT():null,pt=s.useRef(!1),De=s.useCallback($e=>{pt.current=$e},[]);s.useEffect(()=>{if(!et&&!at)return;const $e=Ge=>{const ft=O;if(!ft)return;const Lt=ft.getBoundingClientRect();Ge.clientX>=Lt.left&&Ge.clientX<=Lt.right&&Ge.clientY>=Lt.top&&Ge.clientY<=Lt.bottom&&(Ge.preventDefault(),Ge.stopPropagation(),de(vt=>vt==="shape"&&pt.current?vt:vt==="shape"&&at?"image":et?"shape":"image"))};return document.addEventListener("dblclick",$e,!0),()=>document.removeEventListener("dblclick",$e,!0)},[et,at,O]);const _e=s.useMemo(()=>K&&f.width>0&&f.height>0?xC(ee,f):null,[K,ee,f.width,f.height]),He=s.useRef(null),Ae=(()=>{const $e=He.current;return Y||!T||!$||!we||!_e||!$e||_===$e.customPath||$e.shape!==n&&n!=="custom"?null:nT($e.bounds,_e,we,$e.focalX,$e.focalY,$e.scale)})();nr(()=>{if(!$){He.current=null;return}if(L||!we||!_e)return;const $e=He.current,Ge=!!($e&&_!==$e.customPath);Ge&&Ae&&$.onCommit(Ae),Ge&&Y&&(R==null||R()),He.current={rings:ee,bounds:_e,focalX:(Ae==null?void 0:Ae.focalX)??X,focalY:(Ae==null?void 0:Ae.focalY)??j,scale:(Ae==null?void 0:Ae.scale)??N,customPath:_,shape:n}},[L,Y,_,n,ee,_e,$,we,X,j,N,Ae,R]);const Be=He.current,Ie=!!(L&&!Y&&Be&&!Ae),mt=Ie&&Be?Be.focalX:(Ae==null?void 0:Ae.focalX)??X,ot=Ie&&Be?Be.focalY:(Ae==null?void 0:Ae.focalY)??j,Ct=Ie&&Be?Be.scale:(Ae==null?void 0:Ae.scale)??N,rt=Ie&&Be?Be.bounds:_e,St=s.useMemo(()=>{if(!(f.width>0)||!(f.height>0))return"";let $e=Vd(i,g,o,r,n,f);if(he){const Ge=z??f,ft=r.width/Ge.width,Lt=r.height/Ge.height;$e=un($e,wt=>({x:wt.x*ft,y:wt.y*Lt}))}return Gd($e,f)||zd(ne,f)},[i,g,o,r,n,f.width,f.height,he,z,ne]),nt=s.useMemo(()=>{if(!K||!(f.width>0)||!(f.height>0))return"";let $e=Vd(_,g,o,r,n,f);if(he){const Ge=z??f,ft=r.width/Ge.width,Lt=r.height/Ge.height;$e=un($e,wt=>({x:wt.x*ft,y:wt.y*Lt}))}return Gd($e,f)||zd(ee,f)},[K,_,g,o,r,n,f.width,f.height,he,z,ee]),Rt=`${G}-clip`,ht=s.useMemo(()=>{if(!rt)return null;const $e=we??{width:rt.width,height:rt.height},Ge=Ui(rt,$e,Ct);return{x:jn(rt.width,Ge.width,mt),y:jn(rt.height,Ge.height,ot),width:Ge.width,height:Ge.height}},[rt,we,mt,ot,Ct]);return a.jsxs("div",{className:`${e}-column`,style:{padding:S,columnGap:h},lang:Fe,ref:U,children:[St?a.jsxs("svg",{className:`${e}-shape-fill`,style:{top:0,left:0,width:f.width,height:f.height},viewBox:`0 0 ${f.width} ${f.height}`,preserveAspectRatio:"none","aria-hidden":!0,children:[a.jsx("path",{className:`${e}-shape-fill-path`,d:St,fillRule:"evenodd"}),K&&nt&&rt&&ht?a.jsxs(a.Fragment,{children:[a.jsx("defs",{children:a.jsx("clipPath",{id:Rt,clipPathUnits:"userSpaceOnUse",children:a.jsx("path",{d:nt,fillRule:"evenodd"})})}),a.jsx("image",{href:K,x:rt.x+ht.x,y:rt.y+ht.y,width:ht.width,height:ht.height,preserveAspectRatio:"none",clipPath:`url(#${Rt})`})]}):null]}):null,a.jsxs("div",{className:`${e}-flow${d?"":` ${e}-clip`}`,style:{...M,["--"+e+"-fit"]:Xe,top:0,left:0,width:f.width,height:f.height},children:[a.jsx("div",{className:`${e}-measure`,ref:E,style:M,"aria-hidden":!0}),Ue.segments.map(($e,Ge)=>{const ft=Ue.renderTokens.slice($e.from,$e.to),Lt=Ge===0;return a.jsx("div",{className:`${e}-line${$e.justify?` ${e}-line-justify`:""}`,"aria-hidden":!0,style:{top:`${$e.top}px`,left:`${$e.left}px`,width:`${$e.width}px`,textAlign:$e.justify?void 0:ye},children:ft.map((wt,vt)=>{const Wt=Se&&Lt&&$e.from===0&&vt===0?wt.text.slice(1):wt.text,Dt=lu(wt.leaf),Me=wt.href?a.jsx("a",{className:`${e}-link`,href:wt.href,target:wt.target,rel:wt.target?"noopener noreferrer":void 0,style:Dt,children:Wt}):a.jsx("span",{style:Dt,children:Wt});return a.jsxs("span",{children:[!$e.justify&&vt>0?" ":null,Me]},vt)})},`${$e.from}-${$e.to}-${Ge}`)}),P&&!g&&a.jsx("svg",{className:`${e}-guides`,viewBox:"0 0 1 1",preserveAspectRatio:"none","aria-hidden":!0,children:ne.map(($e,Ge)=>a.jsx("polygon",{points:$e.map(ft=>`${ft.x},${ft.y}`).join(" ")},Ge))})]}),Se&&C&&a.jsx("div",{className:`${e}-drop-cap`,"aria-hidden":!0,style:{...M,top:`${Ue.capTop+it}px`,left:`${Ue.capLeft}px`,fontSize:`${We}px`,lineHeight:`${We}px`},children:Se}),xt&&Ye&&(g&&I||$)&&qn.createPortal(a.jsxs("div",{"data-selection":"none",style:{position:"fixed",top:Ye.top,left:Ye.left,width:Ye.width,height:Ye.height,zIndex:ET,pointerEvents:"none"},children:[g&&I&&a.jsx(ST,{P:e,box:{width:Ye.width,height:Ye.height},viewBox:r,contours:g,snap:I.snap,stretchToBox:!he,uniformStretch:n==="circle",stage:Pe,onStageChange:de,onSelectionChange:De,onChange:I.onChange,onCommit:I.onCommit}),$&&rt&&a.jsx(hT,{P:e,box:{width:Ye.width,height:Ye.height},bounds:rt,natural:we,imageUrl:K,maskPath:nt,stage:Pe,onStageChange:de,focalX:mt,focalY:ot,scale:Ct,onChange:$.onChange,onCommit:$.onCommit})]}),xt),a.jsx("div",{className:`${e}-a11y`,children:le.map(($e,Ge)=>a.jsx("p",{children:$e},Ge))}),Qe&&a.jsxs("svg",{className:`${e}-overflow-icon`,width:"33",height:"24",viewBox:"0 0 33 24",style:{top:Ze.top,left:Ze.left},"aria-hidden":!0,children:[a.jsx("path",{d:"M12.8,4 L20.2,4 C24.68042,4 26.9206301,4 28.631924,4.87194781 C31.3123488,6.23769248 33,8.99168887 33,12 C33,15.0083111 31.3123488,17.7623075 28.631924,19.1280522 C26.9206301,20 24.68042,20 20.2,20 L12.8,20 C8.31957995,20 6.07936993,20 4.368076,19.1280522 C1.68765116,17.7623075 0,15.0083111 0,12 C0,8.99168887 1.68765116,6.23769248 4.368076,4.87194781 C6.07936993,4 8.31957995,4 12.8,4 Z",fill:"#FF4400"}),a.jsx("path",{transform:"translate(5, 0)",fill:"#FFFFFF",d:"M12,5.625 C12.3846269,5.625 12.7016304,5.91453014 12.7449542,6.28753416 L12.75,6.375 L12.75,11.25 L17.625,11.25 C18.0392136,11.25 18.375,11.5857864 18.375,12 C18.375,12.3846269 18.0854699,12.7016304 17.7124658,12.7449542 L17.625,12.75 L12.75,12.75 L12.75,17.625 C12.75,18.0392136 12.4142136,18.375 12,18.375 C11.6153731,18.375 11.2983696,18.0854699 11.2550458,17.7124658 L11.25,17.625 L11.25,12.75 L6.375,12.75 C5.96078644,12.75 5.625,12.4142136 5.625,12 C5.625,11.6153731 5.91453014,11.2983696 6.28753416,11.2550458 L6.375,11.25 L11.25,11.25 L11.25,6.375 C11.25,5.96078644 11.5857864,5.625 12,5.625 Z"})]})]})}const Zp=["diamond","parallelogram","vase","circle","shield","bobbin","custom"],HT={x:0,y:0,width:100,height:100},WT=e=>{const t=(e??"").trim().split(/[\s,]+/).map(Number).filter(n=>!Number.isNaN(n));return t.length<4||t[2]<=0||t[3]<=0?HT:{x:t[0],y:t[1],width:t[2],height:t[3]}},OT=e=>`
|
|
27904
27900
|
.${e}-wrapper {
|
|
27905
27901
|
box-sizing: border-box;
|
|
27906
27902
|
display: flex;
|