@cntrl-site/components 1.0.105 → 1.0.106

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.
Files changed (88) hide show
  1. package/dist/ClickGallerie-CYQMgrIr.js +36 -0
  2. package/dist/ClickGallerie-o2U6oyOF.mjs +272 -0
  3. package/dist/Components/ClickGallerie/ClickGallerie.d.ts +2 -1
  4. package/dist/Components/Helix/Helix.d.ts +4 -1
  5. package/dist/Components/Hive/Hive.d.ts +4 -1
  6. package/dist/Components/ImageRevealSlider/ImageRevealSlider.d.ts +2 -1
  7. package/dist/Components/List/List.d.ts +6 -2
  8. package/dist/Components/Marquee/Marquee.d.ts +6 -2
  9. package/dist/Components/MarqueeText/MarqueeText.d.ts +2 -1
  10. package/dist/Components/Mercury/Mercury.d.ts +4 -1
  11. package/dist/Components/Waterfall/WaterfallLightbox.d.ts +4 -1
  12. package/dist/Components/utils/EmbedMediaFrame.d.ts +27 -0
  13. package/dist/Components/utils/LinkWrapper.d.ts +16 -0
  14. package/dist/Components/utils/embedMedia.d.ts +40 -0
  15. package/dist/Components/utils/index.d.ts +6 -0
  16. package/dist/{ControlSlider-SiOt22l_.js → ControlSlider-Kkec-i14.js} +1 -1
  17. package/dist/{ControlSlider-pZv7H6BU.mjs → ControlSlider-LcZmviGX.mjs} +1 -1
  18. package/dist/EmbedMediaFrame-DsOTKE4i.js +1 -0
  19. package/dist/EmbedMediaFrame-DwHeOAy5.mjs +164 -0
  20. package/dist/{FAQ-C7823fyi.js → FAQ-BxhMo7T8.js} +1 -1
  21. package/dist/{FAQ-CZ39u4m8.mjs → FAQ-CdwSft5p.mjs} +1 -1
  22. package/dist/Grid-CFHTP3mb.js +378 -0
  23. package/dist/Grid-e-gLfsji.mjs +1590 -0
  24. package/dist/Helix-BpLo9FD3.js +43 -0
  25. package/dist/Helix-CidI3ucE.mjs +324 -0
  26. package/dist/{Hive-D6-R6TwM.mjs → Hive-BsmFHk2i.mjs} +505 -475
  27. package/dist/Hive-D1j6wZpV.js +321 -0
  28. package/dist/ImageRevealSlider-BuukTGAK.js +1 -0
  29. package/dist/{ImageRevealSlider-BdFGyVEP.mjs → ImageRevealSlider-Df9sygk9.mjs} +63 -70
  30. package/dist/{Lightbox-eP9qAZzL.mjs → Lightbox-C_fXsfdz.mjs} +1 -1
  31. package/dist/{Lightbox-CIss_nOG.js → Lightbox-DaunVrkp.js} +1 -1
  32. package/dist/LinkWrapper-Ca84iPtg.js +1 -0
  33. package/dist/LinkWrapper-DZs9hlOn.mjs +13 -0
  34. package/dist/{List-DW7fyJbf.mjs → List-Bh_-l9vD.mjs} +532 -520
  35. package/dist/List-DVvpQ24J.js +377 -0
  36. package/dist/Marquee-DByooiWP.mjs +578 -0
  37. package/dist/Marquee-DfIP-tIN.js +133 -0
  38. package/dist/{MarqueeText-Rzt2fJYt.mjs → MarqueeText-D6FNCe6P.mjs} +115 -114
  39. package/dist/MarqueeText-DsUiV6Zv.js +132 -0
  40. package/dist/Mercury-B-s2Kvuq.js +267 -0
  41. package/dist/Mercury-CCW0Es-s.mjs +1700 -0
  42. package/dist/PretextComponent-Dnbenstn.js +1 -0
  43. package/dist/{PretextComponent-j-OsRZTx.mjs → PretextComponent-OygSO3fr.mjs} +312 -269
  44. package/dist/{RichTextRenderer-B6WtTYlR.mjs → RichTextRenderer-BptwNpbJ.mjs} +10 -9
  45. package/dist/RichTextRenderer-K90Dd7pt.js +1 -0
  46. package/dist/{Slider20-Dm8BeCli.mjs → Slider20-CCzixTiN.mjs} +1 -1
  47. package/dist/{Slider20-C9o2REDl.js → Slider20-fMVeRfgx.js} +1 -1
  48. package/dist/{TestimonialGrid-CPu4qQ6B.mjs → TestimonialGrid-CbsVxSn9.mjs} +1 -1
  49. package/dist/{TestimonialGrid-D4ieiz9e.js → TestimonialGrid-CiCagfBU.js} +1 -1
  50. package/dist/{TestimonialSingle-DLdnAVF7.mjs → TestimonialSingle-BVm3Amrl.mjs} +1 -1
  51. package/dist/{TestimonialSingle-CVu15ZtV.js → TestimonialSingle-BWXynGjv.js} +1 -1
  52. package/dist/Waterfall-3kKioKh2.mjs +1432 -0
  53. package/dist/Waterfall-DII4-WV5.js +288 -0
  54. package/dist/{components-D2LyuDm-.mjs → components-BRmbflgg.mjs} +15 -15
  55. package/dist/components-nvbH4l0S.js +1 -0
  56. package/dist/content/postFieldBindings.d.ts +29 -0
  57. package/dist/elements.js +1 -1
  58. package/dist/elements.mjs +16 -16
  59. package/dist/elements.node.js +1 -1
  60. package/dist/elements.node.mjs +1 -1
  61. package/dist/index.d.ts +3 -1
  62. package/dist/index.js +1 -1
  63. package/dist/index.mjs +52 -15
  64. package/dist/sources.js +312 -212
  65. package/dist/sources.mjs +312 -212
  66. package/dist/types/SchemaV1.d.ts +53 -1
  67. package/dist/utils.js +1 -1
  68. package/dist/utils.mjs +30 -20
  69. package/package.json +1 -1
  70. package/dist/ClickGallerie-D7g093HX.js +0 -36
  71. package/dist/ClickGallerie-QSOQjSdv.mjs +0 -271
  72. package/dist/Grid-BBpdl60K.js +0 -374
  73. package/dist/Grid-DS53S_gA.mjs +0 -1576
  74. package/dist/Helix-BPn9V1sg.mjs +0 -315
  75. package/dist/Helix-DcgsCc4D.js +0 -43
  76. package/dist/Hive-n8Fz-j3o.js +0 -321
  77. package/dist/ImageRevealSlider-BBWtFjUF.js +0 -1
  78. package/dist/List-C32WImI3.js +0 -377
  79. package/dist/Marquee-DOIRRCu4.js +0 -133
  80. package/dist/Marquee-O_PDwlIb.mjs +0 -564
  81. package/dist/MarqueeText-DkaO2lQ5.js +0 -132
  82. package/dist/Mercury-C9D10TTT.mjs +0 -1702
  83. package/dist/Mercury-DynO-NxY.js +0 -267
  84. package/dist/PretextComponent-BnsS2zJ6.js +0 -1
  85. package/dist/RichTextRenderer-CIy6yI8U.js +0 -1
  86. package/dist/Waterfall-DC2WQ3GT.js +0 -287
  87. package/dist/Waterfall-Yud2VR62.mjs +0 -1404
  88. package/dist/components-B9Vdjf0w.js +0 -1
@@ -0,0 +1,133 @@
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const y=require("react/jsx-runtime"),a=require("react"),te=require("classnames"),Ee=require("./scalingValue-CSHYgTZl.js"),Ce=require("./useScopedStyles-Bf6yohVQ.js"),J=require("./useLazyVideos-CdCbc2j0.js"),Se=require("./LinkWrapper-Ca84iPtg.js"),ne=require("./EmbedMediaFrame-DsOTKE4i.js"),de=require("./observeIntersection-DxGj9Ctt.js");function ke(e,n){const r=n>0?`${n}px`:"0px";return`
2
+ .${e}-marquee-wrapper {
3
+ overflow: hidden;
4
+ width: 100%;
5
+ height: auto;
6
+ }
7
+
8
+ @keyframes ${e}-marquee-left {
9
+ from { -webkit-transform: translate3d(0, 0, 0); transform: translate3d(0, 0, 0); }
10
+ to { -webkit-transform: translate3d(-${r}, 0, 0); transform: translate3d(-${r}, 0, 0); }
11
+ }
12
+
13
+ @keyframes ${e}-marquee-right {
14
+ from { -webkit-transform: translate3d(-${r}, 0, 0); transform: translate3d(-${r}, 0, 0); }
15
+ to { -webkit-transform: translate3d(0, 0, 0); transform: translate3d(0, 0, 0); }
16
+ }
17
+
18
+ .${e}-marquee-track {
19
+ display: flex;
20
+ flex-direction: row;
21
+ width: max-content;
22
+ will-change: transform;
23
+ backface-visibility: hidden;
24
+ -webkit-backface-visibility: hidden;
25
+ flex-wrap: nowrap;
26
+ -webkit-animation-timing-function: linear;
27
+ animation-timing-function: linear;
28
+ -webkit-animation-iteration-count: infinite;
29
+ animation-iteration-count: infinite;
30
+ }
31
+
32
+ .${e}-marquee-track[data-direction="left"] {
33
+ -webkit-animation-name: ${e}-marquee-left;
34
+ animation-name: ${e}-marquee-left;
35
+ }
36
+
37
+ .${e}-marquee-track[data-direction="right"] {
38
+ -webkit-animation-name: ${e}-marquee-right;
39
+ animation-name: ${e}-marquee-right;
40
+ }
41
+ .${e}-marquee-row {
42
+ display: flex;
43
+ flex-direction: row;
44
+ align-items: flex-start;
45
+ }
46
+ .${e}-marquee-set {
47
+ flex: 0 0 auto;
48
+ }
49
+ .${e}-marquee-static {
50
+ justify-content: center;
51
+ overflow-x: auto;
52
+ }
53
+ .${e}-marquee-card {
54
+ position: relative;
55
+ flex: 0 0 auto;
56
+ align-self: flex-start;
57
+ }
58
+ .${e}-wrapper {
59
+ position: relative;
60
+ width: 100%;
61
+ height: 100%;
62
+ order: 1;
63
+ }
64
+ .${e}-cover {
65
+ position: absolute;
66
+ width: 100%;
67
+ height: 100%;
68
+ top: 0;
69
+ left: 0;
70
+ }
71
+ .${e}-elements-overlay {
72
+ position: relative;
73
+ inset: 0;
74
+ display: flex;
75
+ flex-direction: column;
76
+ pointer-events: none;
77
+ }
78
+ .${e}-control {
79
+ position: relative;
80
+ z-index: 2;
81
+ width: 100%;
82
+ }
83
+
84
+ .${e}-marquee-link {
85
+ display: flex;
86
+ flex-direction: column;
87
+ justify-content: center;
88
+ align-items: center;
89
+ width: 100%;
90
+ height: 100%;
91
+ text-decoration: none;
92
+ color: inherit;
93
+ }
94
+ .${e}-marquee-link-contain {
95
+ width: auto;
96
+ height: auto;
97
+ }
98
+
99
+ .${e}-control::before {
100
+ content: "";
101
+ position: absolute;
102
+ top: 0;
103
+ left: 0;
104
+ width: 100%;
105
+ height: 100%;
106
+ min-height: 20px;
107
+ pointer-events: auto;
108
+ z-index: 10;
109
+ }
110
+
111
+ .${e}-gap-control {
112
+ position: relative;
113
+ z-index: 2;
114
+ pointer-events: auto;
115
+ height: 100%;
116
+ }
117
+ .${e}-image-hover-brightness img,
118
+ .${e}-image-hover-brightness video {
119
+ transition: filter 0.3s ease;
120
+ }
121
+ .${e}-image-hover-brightness:hover img,
122
+ .${e}-image-hover-brightness:hover video {
123
+ filter: brightness(1.25);
124
+ }
125
+ .${e}-image-hover-grayscale img,
126
+ .${e}-image-hover-grayscale video {
127
+ transition: filter 0.3s ease;
128
+ }
129
+ .${e}-image-hover-grayscale:hover img,
130
+ .${e}-image-hover-grayscale:hover video {
131
+ filter: grayscale(100%);
132
+ }
133
+ `}const Ae=30,Ne=20,fe=3,Me=12,_e=32,We=3,Ie=250,je=.5,Ve=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")},Te=(e,n)=>Array.from({length:n},()=>e).flat(),Le=e=>typeof e=="string"?{display:e.toLowerCase()==="cover"?"cover":"fit",ratioValue:"16:9",reversed:!1}:{display:(typeof(e==null?void 0:e.display)=="string"?e.display.toLowerCase():"")==="cover"?"cover":"fit",ratioValue:(e==null?void 0:e.ratioValue)??"16:9",reversed:(e==null?void 0:e.reversed)??!1},we=e=>e.reduce((n,r)=>n+(r.offsetWidth||r.getBoundingClientRect().width),0),be=(e,n)=>{if(n<=0||e.children.length<n)return 0;const r=e.children[0],u=e.children[n-1];if(!r||!u)return 0;const h=getComputedStyle(e),f=Number.parseFloat(h.columnGap||h.gap||"0")||0,w=u.getBoundingClientRect().right-r.getBoundingClientRect().left;if(w>0)return w;const C=Array.from({length:n},(R,_)=>e.children[_]),m=we(C);return m<=0?0:m+f*Math.max(0,n-1)},Oe=e=>{const n=e.getBoundingClientRect().width;if(n>0)return n;const r=e.offsetWidth;if(r>0)return r;const u=we(Array.from(e.children));if(u<=0)return 0;const h=getComputedStyle(e),f=Number.parseFloat(h.columnGap||h.gap||"0")||0,w=Number.parseFloat(h.paddingRight)||0;return u+f*Math.max(0,e.children.length-1)+w},Be=(e,n)=>{const r=n.getBoundingClientRect(),u=e.getBoundingClientRect();return u.right>r.left&&u.left<r.right},He=(e,n)=>{const r=e.querySelectorAll(`[data-marquee-item-index="${n}"]`);return Array.from(r).some(u=>Be(u,e))},ze=e=>{if(ne.isEmbedMedia(e))return!1;if(e.type==="video")return!0;if(e.type==="image")return!1;const n=e.name??"";return/\.(mp4|webm|ogg|mov)(\?|$)/i.test(n)?!0:/\.(mp4|webm|ogg|mov)(\?|$)/i.test(e.assetId??"")},Fe=e=>e?e instanceof HTMLVideoElement?e.readyState>=1:e.complete:!1,Ue=({item:e,prefix:n,imageFit:r,imageMaxWidth:u,imageMaxHeight:h,cornerRadius:f,imageHoverClass:w,isFirstSet:C,scaled:m,onFirstSetImageDone:R})=>{var O,B,K,H,ee;const _=a.useRef(null),X=!!((O=e.image)!=null&&O.assetId&&ze(e.image)),V=!!((B=e.image)!=null&&B.assetId&&ne.isEmbedMedia(e.image));a.useLayoutEffect(()=>{C&&(V||Fe(_.current))&&(R==null||R())},[C,V,(K=e.image)==null?void 0:K.assetId,R]);const $=r.display==="cover",Z=r.ratioValue??"1:1",D=r.reversed??!1,[S,P]=Z.split(":").map(Number),A=(D?P:S)/(D?S:P),W=u/A,I=W>h?h:W,oe=W>h?h*A:u,k=m(oe),me=m(I),v={borderRadius:m(f)},N=$?{pointerEvents:"auto",display:"block",width:"100%",height:"100%",objectFit:"cover",...v}:{pointerEvents:"auto",display:"block",width:"auto",height:"auto",maxWidth:m(u),maxHeight:m(h),objectFit:"contain",...v},q=V&&e.image?ne.getEmbedAspect(e.image):null,j=q===null?void 0:$?N:{...N,width:m(u/q>h?h*q:u),height:m(u/q>h?h:u/q)},L=((H=e.image)==null?void 0:H.assetId)&&(V?y.jsx(ne.EmbedMediaFrame,{media:e.image,fit:$?"cover":"contain",style:j}):X?y.jsx("video",{ref:z=>{_.current=z},src:e.image.assetId,style:N,muted:!0,loop:!0,playsInline:!0,preload:"none",onLoadedMetadata:C?R:void 0,onError:C?R:void 0}):y.jsx("img",{ref:z=>{_.current=z},src:e.image.assetId,alt:((ee=e.image)==null?void 0:ee.name)??"",style:N,onLoad:C?R:void 0,onError:C?R:void 0}));return y.jsx("div",{style:{display:"flex",flexDirection:"column",alignItems:"start",...$?{width:k}:{width:"max-content",maxWidth:m(u),minWidth:0}},children:y.jsx("div",{className:w,style:{display:"flex",flexDirection:"column",justifyContent:"center",alignItems:"center",flexShrink:0,...$?{width:k,height:me,overflow:"hidden",...v}:{width:"max-content",maxWidth:m(u),height:m(h)}},children:L&&y.jsx(Se.LinkWrapper,{link:e.link,className:te(`${n}-marquee-link`,!$&&`${n}-marquee-link-contain`),children:L})})})},Ge=({settings:e,content:n,isEditor:r,isPreviewMode:u,isEditMode:h})=>{const{prefix:f}=Ce.useScopedStyles(),[w,C]=a.useState(0),m=w>0?Math.round(w):0,R=a.useMemo(()=>ke(f,m),[f,m]),{speed:_,direction:X,pauseOnHover:V,gap:$,imageMaxWidth:Z,imageMaxHeight:D,hoverEffect:S,cornerRadius:P=0}=e,T=a.useMemo(()=>Le(e.imageFit),[e.imageFit]),re=T.display!=="cover",A=(n==null?void 0:n.length)??0,W=!!h,I=!r||!!u,oe=I&&S!=="off"&&S!=="randomize"?`${f}-image-hover-${S}`:void 0,k=r?!!u:!0,v=((n==null?void 0:n.length)??0)>0&&(k||!!r),N=Math.max(0,_)*Ae,q=t=>Ee.scalingValue(t,r??!1),j=a.useRef(null),L=a.useRef(null),O=a.useRef(null),[B,K]=a.useState(0),H=k&&V==="on",[ee,z]=a.useState(!1),[F,ae]=a.useState({}),ie=a.useRef(F);ie.current=F;const se=a.useRef(null),ce=a.useRef(0),Q=a.useRef(null),he=a.useMemo(()=>(n??[]).map(t=>{var o;return((o=t.image)==null?void 0:o.assetId)??""}).join("\0"),[n]),[U,pe]=a.useState(fe),le=a.useMemo(()=>{const t=n??[];return t.length===0||!(k||!!r)?t:Te(t,U)},[n,k,U,r]),ge=a.useMemo(()=>(n??[]).filter(t=>{var o;return!!((o=t.image)!=null&&o.assetId)}).length,[n]),ye=v?We:1;a.useLayoutEffect(()=>{ce.current=0,ae({}),se.current=null,pe(fe),C(0)},[he]),a.useEffect(()=>{if(!I||S!=="randomize")return;const t=j.current;if(!t)return;const o=c=>{ae(l=>{const b=Array.from(c).filter(g=>g in l&&!He(t,g));if(b.length===0)return l;const p={...l};return b.forEach(g=>{delete p[g]}),p})},i=new IntersectionObserver(c=>{const l=new Set;for(const b of c){const p=b.target.dataset.marqueeItemIndex,g=p!==void 0?Number(p):NaN;Number.isNaN(g)||l.add(g)}l.size>0&&o(l)},{root:t,threshold:0});Object.keys(F).forEach(c=>{const l=Number(c);t.querySelectorAll(`[data-marquee-item-index="${l}"]`).forEach(b=>i.observe(b))});const d={current:0},s=()=>{const c=Object.keys(ie.current);c.length!==0&&(o(c.map(Number)),d.current=requestAnimationFrame(s))};return Object.keys(ie.current).length>0&&(d.current=requestAnimationFrame(s)),()=>{cancelAnimationFrame(d.current),i.disconnect()}},[S,F,I]),a.useEffect(()=>{const t=j.current;if(!t||typeof IntersectionObserver>"u")return;let o=!1,i=!1,d;const s=()=>{const p=t.querySelectorAll("video");if(!o){p.forEach(J.pauseVideo);return}const g=t.getBoundingClientRect(),M=g.width*je;p.forEach(x=>{const Y=x.getBoundingClientRect(),G=Y.right>g.left&&Y.left<g.right;Y.right>g.left-M&&Y.left<g.right+M?J.raisePreload(x,"auto"):re&&J.raisePreload(x,"metadata"),i&&G?x.paused&&J.playVideo(x):J.pauseVideo(x)})},c=()=>{o&&d===void 0?d=setInterval(s,Ie):!o&&d!==void 0&&(clearInterval(d),d=void 0),s()},l=de.observeIntersection(t,de.NEAR_VIEWPORT_MARGIN,p=>{o=p,c()}),b=de.observeIntersection(t,"0px",p=>{i=p,c()});return()=>{l(),b(),clearInterval(d)}},[v,re]),a.useLayoutEffect(()=>{if(!v)return;const t=j.current,o=O.current;if(!t||!o)return;const i={current:0},d=()=>{const l=t.getBoundingClientRect().width||t.offsetWidth,b=Oe(o),p=se.current,g=typeof p=="number"&&Math.abs(p-b)<=.25;se.current=b;let M=U,x=0;if((k||r)&&A>0&&l>0){const E=be(o,A);if(E>=_e){x=E;const ue=Math.min(Me,Math.max(fe,Math.ceil(l/E)+1));M=ue,ue!==U&&pe(ue)}}const G=M!==U&&x>0?x*M:b>0?b:x>0?x*M:(()=>{const E=be(o,A);return E>0?E*M:0})();G>0?C(E=>E<=0?G:!g||Math.round(E)===Math.round(G)?E:G):!g&&w<=0&&(cancelAnimationFrame(i.current),i.current=requestAnimationFrame(d))},s=()=>{cancelAnimationFrame(i.current),i.current=requestAnimationFrame(d)};Q.current=s,s();const c=new ResizeObserver(s);return c.observe(t),c.observe(o),()=>{Q.current=null,cancelAnimationFrame(i.current),c.disconnect()}},[k,v,w,he,U,A,r]),a.useLayoutEffect(()=>{if(!v||m<=0)return;const t=L.current;t&&Ve(t)},[v,m,X,N]),a.useLayoutEffect(()=>{if(!v||w<=0){K(0);return}const t=L.current,o=O.current;if(!t||!o)return;const i=()=>{const s=t.offsetHeight||t.getBoundingClientRect().height,c=Array.from(o.children).reduce((b,p)=>Math.max(b,p.offsetHeight||p.getBoundingClientRect().height),0),l=s>0?s:c;K(l>0?l:0)};i();const d=new ResizeObserver(i);return d.observe(t),d.observe(o),()=>d.disconnect()},[v,ye,le,r,$,Z,D,w,T,F]),a.useLayoutEffect(()=>{if(!r||!W||!v||typeof window>"u")return;const t=requestAnimationFrame(()=>{window.dispatchEvent(new Event("scroll"))});return()=>cancelAnimationFrame(t)},[r,W,v,X,w,B,$,le]);const $e=()=>{H&&z(!0)},Re=()=>{H&&z(!1)},qe=a.useCallback(()=>{var t;ce.current=Math.min(ge,ce.current+1),(t=Q.current)==null||t.call(Q)},[ge]),xe=a.useCallback((t,o)=>{ae(i=>{const d=i[t]??o,s=(n??[]).filter(l=>l!==d);if(s.length===0)return i;const c=s[Math.floor(Math.random()*s.length)];return{...i,[t]:c}})},[n]),ve=(t,o,i,d)=>{const s=I&&S==="randomize"&&T.display==="cover"?F[i]??t:t,c=`max(${q($)}, ${Ne}px)`,l=`calc(-0.5 * (${c} + ${q($)}))`;return y.jsxs("div",{className:`${f}-marquee-card`,"data-marquee-item-index":i,onMouseEnter:I&&S==="randomize"&&T.display==="cover"?()=>xe(i,t):void 0,children:[y.jsx(Ue,{item:s,prefix:f,imageFit:T,imageMaxWidth:Z,imageMaxHeight:D,cornerRadius:P,imageHoverClass:oe,isEditor:r,isFirstSet:d,scaled:q,onFirstSetImageDone:qe}),W&&y.jsx("div",{"data-controls":"gap","data-controls-axis":"x",className:`${f}-gap-control`,style:{position:"absolute",top:0,right:l,width:c,height:"100%"}})]},`${o}-${i}`)};if(v){const t=k?H&&ee?"paused":"running":"paused",o=m>0&&N>0?m/N*1e3:0,i=`${Math.max(0,o)/1e3}s`;return y.jsxs("div",{ref:j,className:te(`${f}-wrapper`,`${f}-marquee-wrapper`),"aria-label":"Marquee",style:B>0?{height:B}:void 0,children:[y.jsx("style",{dangerouslySetInnerHTML:{__html:R}}),y.jsx("div",{ref:L,className:`${f}-marquee-track`,"data-direction":X,onMouseEnter:$e,onMouseLeave:Re,style:{WebkitAnimationDuration:i,animationDuration:i,WebkitAnimationPlayState:t,animationPlayState:t},children:Array.from({length:ye},(d,s)=>y.jsx("div",{ref:s===0?O:void 0,className:te(`${f}-marquee-row`,`${f}-marquee-set`),style:{gap:q($),paddingRight:q($)},"aria-hidden":s>0,children:le.map((c,l)=>ve(c,s,l,s===0&&l<A))},`set-${s}`))})]})}return y.jsxs("div",{ref:j,className:`${f}-wrapper`,children:[y.jsx("style",{dangerouslySetInnerHTML:{__html:R}}),y.jsx("div",{className:te(`${f}-marquee-row`,`${f}-marquee-static`),style:{gap:q($),transform:"none"},"aria-label":"Marquee",children:n==null?void 0:n.map((t,o)=>ve(t,0,o))},"marquee-static")]})};exports.Marquee=Ge;
@@ -3,9 +3,10 @@ import { useState as H, useMemo as ue, useRef as L, useLayoutEffect as W } from
3
3
  import Rt from "classnames";
4
4
  import { s as qt } from "./scalingValue-C9JH5L6O.mjs";
5
5
  import { u as Ft } from "./useScopedStyles-DhBG3557.mjs";
6
- import { t as Lt } from "./textStylesToCss-05Mn6I_2.mjs";
7
- import { o as Tt } from "./observeIntersection-B0f3L2iK.mjs";
8
- function _t(e, r, o) {
6
+ import { L as Lt } from "./LinkWrapper-DZs9hlOn.mjs";
7
+ import { t as Tt } from "./textStylesToCss-05Mn6I_2.mjs";
8
+ import { o as _t } from "./observeIntersection-B0f3L2iK.mjs";
9
+ function Wt(e, r, o) {
9
10
  const s = r > 0 ? `${r}px` : "0px", a = o ? `
10
11
  .${e}-item-image-wrap {
11
12
  display: flex;
@@ -140,20 +141,20 @@ ${a}
140
141
  }
141
142
  `;
142
143
  }
143
- const Wt = 30, Se = 3, Nt = 12, Bt = 96, Ge = 3, de = 0.72, Ht = 100, Ot = 10, zt = (e) => e / Ht, Pt = (e) => Math.max(0, e) / Ot, Dt = (e) => {
144
+ const Nt = 30, Se = 3, Bt = 12, Ht = 96, Ge = 3, de = 0.72, Ot = 100, zt = 10, Pt = (e) => e / Ot, Dt = (e) => Math.max(0, e) / zt, It = (e) => {
144
145
  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");
145
- }, It = (e, r) => Array.from({ length: r * e.length }, (o, s) => e[s % e.length]), j = { ctx: void 0 }, Ut = () => j.ctx !== void 0 ? j.ctx : typeof document > "u" ? (j.ctx = null, j.ctx) : (j.ctx = document.createElement("canvas").getContext("2d"), j.ctx), Xt = (e, r, o, s) => {
146
+ }, Ut = (e, r) => Array.from({ length: r * e.length }, (o, s) => e[s % e.length]), j = { ctx: void 0 }, Xt = () => j.ctx !== void 0 ? j.ctx : typeof document > "u" ? (j.ctx = null, j.ctx) : (j.ctx = document.createElement("canvas").getContext("2d"), j.ctx), Vt = (e, r, o, s) => {
146
147
  e.style.transform = `translate3d(${r}px, ${o}px, 0) rotate(${s}deg)`;
147
148
  }, Je = (e) => {
148
149
  e.style.transform = "";
149
- }, Vt = (e) => {
150
+ }, jt = (e) => {
150
151
  if (!e || e === "none") return 0;
151
152
  try {
152
153
  return new DOMMatrixReadOnly(e).m41;
153
154
  } catch {
154
155
  return 0;
155
156
  }
156
- }, jt = (e, r) => {
157
+ }, Yt = (e, r) => {
157
158
  const o = (s, a) => {
158
159
  if (!s || s === r) return a;
159
160
  const d = a + s.offsetLeft, c = s.offsetParent;
@@ -163,28 +164,28 @@ const Wt = 30, Se = 3, Nt = 12, Bt = 96, Ge = 3, de = 0.72, Ht = 100, Ot = 10, z
163
164
  }, Ze = 96, et = (e, r, o) => {
164
165
  if (r <= 0 || Math.abs(e) <= 0 || o < 2) return null;
165
166
  const s = 2 * Math.PI / r, a = new Float64Array(o + 1), d = new Float64Array(o + 1), c = e * r, l = (u) => Math.sqrt(1 + (c * Math.cos(r * u)) ** 2), w = s / o;
166
- return Array.from({ length: o }, (u, k) => {
167
- const x = k * w, S = x + w;
168
- a[k + 1] = S, d[k + 1] = d[k] + (l(x) + l(S)) * 0.5 * w;
167
+ return Array.from({ length: o }, (u, M) => {
168
+ const x = M * w, k = x + w;
169
+ a[M + 1] = k, d[M + 1] = d[M] + (l(x) + l(k)) * 0.5 * w;
169
170
  }), { wavelength: s, periodArc: d[o], x: a, s: d };
170
- }, Yt = (e, r) => {
171
+ }, Kt = (e, r) => {
171
172
  const o = et(e, r, Ze);
172
173
  return !o || o.wavelength <= 0 ? 1 : o.periodArc / o.wavelength;
173
- }, Kt = (e, r) => {
174
+ }, Qt = (e, r) => {
174
175
  if (e.periodArc <= 0) return r;
175
176
  const o = r < 0 ? -1 : 1, s = Math.abs(r), a = Math.floor(s / e.periodArc), d = s - a * e.periodArc, { s: c, x: l } = e, w = (R, $) => {
176
177
  if ($ - R <= 1) return [R, $];
177
178
  const q = R + $ >> 1;
178
179
  return c[q] <= d ? w(q, $) : w(R, q);
179
- }, [u, k] = w(0, c.length - 1), x = c[k] - c[u], S = x > 0 ? (d - c[u]) / x : 0;
180
- return o * (a * e.wavelength + l[u] + (l[k] - l[u]) * S);
181
- }, Qt = (e, r, o, s, a = 0) => {
182
- const d = Math.max(0, o), c = e > 0 ? 2 * Math.PI * d / e : 0, l = ($) => s + r * Math.sin(c * $), w = ($) => r * c * Math.cos(c * $), u = -a, x = e + a - u, S = Math.max(4, Math.ceil(d * 4 * (x / Math.max(e, 1)))), R = Array.from({ length: S }, ($, q) => {
183
- const N = u + q / S * x, F = u + (q + 1) / S * x, O = F - N, ee = l(N), Y = l(F), te = N + O / 3, ne = ee + w(N) * O / 3, me = F - O / 3, re = Y - w(F) * O / 3;
180
+ }, [u, M] = w(0, c.length - 1), x = c[M] - c[u], k = x > 0 ? (d - c[u]) / x : 0;
181
+ return o * (a * e.wavelength + l[u] + (l[M] - l[u]) * k);
182
+ }, Gt = (e, r, o, s, a = 0) => {
183
+ const d = Math.max(0, o), c = e > 0 ? 2 * Math.PI * d / e : 0, l = ($) => s + r * Math.sin(c * $), w = ($) => r * c * Math.cos(c * $), u = -a, x = e + a - u, k = Math.max(4, Math.ceil(d * 4 * (x / Math.max(e, 1)))), R = Array.from({ length: k }, ($, q) => {
184
+ const N = u + q / k * x, F = u + (q + 1) / k * x, O = F - N, ee = l(N), Y = l(F), te = N + O / 3, ne = ee + w(N) * O / 3, me = F - O / 3, re = Y - w(F) * O / 3;
184
185
  return `C${te.toFixed(2)} ${ne.toFixed(2)} ${me.toFixed(2)} ${re.toFixed(2)} ${F.toFixed(2)} ${Y.toFixed(2)}`;
185
186
  });
186
187
  return [`M${u.toFixed(2)} ${l(u).toFixed(2)}`, ...R].join(" ");
187
- }, Gt = ({ item: e, prefix: r, textCss: o, capHeightPx: s, opticalOffsetY: a, imageGapPx: d, isCurve: c }) => {
188
+ }, Jt = ({ item: e, prefix: r, textCss: o, capHeightPx: s, opticalOffsetY: a, imageGapPx: d, isCurve: c }) => {
188
189
  var R;
189
190
  const l = a !== 0 ? { ...o, transform: `translateY(${a}px)` } : o, w = s > 0 ? { height: `${s}px` } : { fontSize: o.fontSize, height: `${de}em` }, u = ((R = e.image) == null ? void 0 : R.assetId) && /* @__PURE__ */ g(
190
191
  "img",
@@ -194,18 +195,18 @@ const Wt = 30, Se = 3, Nt = 12, Bt = 96, Ge = 3, de = 0.72, Ht = 100, Ot = 10, z
194
195
  className: `${r}-item-image`,
195
196
  style: w
196
197
  }
197
- ), k = u && (c ? /* @__PURE__ */ g("span", { className: `${r}-item-image-wrap`, "data-marquee-wave-node": !0, children: u }) : u), x = c ? /* @__PURE__ */ g("span", { className: `${r}-text`, style: l, children: Array.from(e.text).map(($, q) => /* @__PURE__ */ g("span", { className: `${r}-glyph`, "data-marquee-wave-node": !0, children: /* @__PURE__ */ g("span", { className: `${r}-glyph-inner`, children: $ === " " ? " " : $ }) }, q)) }) : /* @__PURE__ */ g("span", { className: `${r}-text`, style: l, children: e.text }), S = /* @__PURE__ */ Ce(Et, { children: [
198
- k,
198
+ ), M = u && (c ? /* @__PURE__ */ g("span", { className: `${r}-item-image-wrap`, "data-marquee-wave-node": !0, children: u }) : u), x = c ? /* @__PURE__ */ g("span", { className: `${r}-text`, style: l, children: Array.from(e.text).map(($, q) => /* @__PURE__ */ g("span", { className: `${r}-glyph`, "data-marquee-wave-node": !0, children: /* @__PURE__ */ g("span", { className: `${r}-glyph-inner`, children: $ === " " ? " " : $ }) }, q)) }) : /* @__PURE__ */ g("span", { className: `${r}-text`, style: l, children: e.text }), k = /* @__PURE__ */ Ce(Et, { children: [
199
+ M,
199
200
  x
200
201
  ] });
201
- return /* @__PURE__ */ g("div", { className: `${r}-item`, "data-marquee-text-item": !0, style: { gap: d }, children: e.link ? /* @__PURE__ */ g("a", { href: e.link, className: `${r}-item-link`, style: { gap: d }, children: S }) : S });
202
- }, an = ({ settings: e, content: r, isEditor: o, isPreviewMode: s }) => {
202
+ return /* @__PURE__ */ g("div", { className: `${r}-item`, "data-marquee-text-item": !0, style: { gap: d }, children: /* @__PURE__ */ g(Lt, { link: e.link, className: `${r}-item-link`, style: { gap: d }, children: k }) });
203
+ }, cn = ({ settings: e, content: r, isEditor: o, isPreviewMode: s }) => {
203
204
  const { prefix: a } = Ft(), [d, c] = H(0), l = d > 0 ? Math.round(d) : 0, {
204
205
  speed: w,
205
206
  direction: u,
206
- pauseOnHover: k,
207
+ pauseOnHover: M,
207
208
  gap: x,
208
- layoutType: S,
209
+ layoutType: k,
209
210
  curveAmplitude: R,
210
211
  curveFrequency: $,
211
212
  textFontFamily: q,
@@ -217,7 +218,7 @@ const Wt = 30, Se = 3, Nt = 12, Bt = 96, Ge = 3, de = 0.72, Ht = 100, Ot = 10, z
217
218
  textColor: te,
218
219
  backgroundColor: ne,
219
220
  ribbonWidth: me
220
- } = e, re = me ?? F, y = S === "curve", I = zt(R), K = Pt($), tt = ue(() => _t(a, l, y), [a, l, y]), z = ue(() => Lt({
221
+ } = e, re = me ?? F, y = k === "curve", I = Pt(R), K = Dt($), tt = ue(() => Wt(a, l, y), [a, l, y]), z = ue(() => Tt({
221
222
  fontSettings: {
222
223
  fontFamily: q,
223
224
  fontWeight: N.fontWeight,
@@ -229,93 +230,93 @@ const Wt = 30, Se = 3, Nt = 12, Bt = 96, Ge = 3, de = 0.72, Ht = 100, Ot = 10, z
229
230
  lineHeight: F,
230
231
  textAppearance: Y,
231
232
  color: te
232
- }, o), [q, N, O, ee, F, Y, te, o]), oe = (t) => qt(t, o ?? !1), P = ((r == null ? void 0 : r.length) ?? 0) > 0, Q = o ? !!s : !0, D = P && (Q || !!o), ie = Math.max(0, w) * Wt, fe = Q && k === "on", [nt, Me] = H(!1), he = Q ? fe && nt ? "paused" : "running" : "paused", pe = he === "running" && ie > 0 && l > 0, rt = l > 0 && ie > 0 ? l / ie * 1e3 : 0, ae = L(null), ge = L(null), ve = L(null), se = L(null), ke = L(null), Ee = L(null), Re = L(pe), G = L(null), J = L(null), xe = L(I), ye = L(K);
233
+ }, o), [q, N, O, ee, F, Y, te, o]), oe = (n) => qt(n, o ?? !1), P = ((r == null ? void 0 : r.length) ?? 0) > 0, Q = o ? !!s : !0, D = P && (Q || !!o), ie = Math.max(0, w) * Nt, fe = Q && M === "on", [nt, Me] = H(!1), he = Q ? fe && nt ? "paused" : "running" : "paused", pe = he === "running" && ie > 0 && l > 0, rt = l > 0 && ie > 0 ? l / ie * 1e3 : 0, ae = L(null), ge = L(null), ve = L(null), se = L(null), ke = L(null), Ee = L(null), Re = L(pe), G = L(null), J = L(null), xe = L(I), ye = L(K);
233
234
  Re.current = pe, xe.current = I, ye.current = K;
234
235
  const [U, qe] = H(0), [ot, Fe] = H(0), [Le, Te] = H(0), [Z, _e] = H(0), [We, it] = H(0), ce = ue(
235
- () => (r ?? []).map((t) => {
236
- var i;
237
- return `${t.text}\0${((i = t.image) == null ? void 0 : i.assetId) ?? ""}\0${t.link ?? ""}`;
236
+ () => (r ?? []).map((n) => {
237
+ var i, t;
238
+ return `${n.text}\0${((i = n.image) == null ? void 0 : i.assetId) ?? ""}\0${((t = n.link) == null ? void 0 : t.value) ?? ""}`;
238
239
  }).join("\0"),
239
240
  [r]
240
241
  ), [X, Ne] = H(Se), at = ue(() => {
241
- const t = r ?? [];
242
- return t.length === 0 || !(Q || o) ? t : It(t, X);
242
+ const n = r ?? [];
243
+ return n.length === 0 || !(Q || o) ? n : Ut(n, X);
243
244
  }, [r, Q, X, o]), st = D ? Ge : 1;
244
245
  W(() => {
245
246
  Ne(Se), c(0);
246
247
  }, [ce]), W(() => {
247
248
  var v;
248
- const t = Ee.current;
249
- if (!t) return;
249
+ const n = Ee.current;
250
+ if (!n) return;
250
251
  const i = () => {
251
- const f = getComputedStyle(t), h = parseFloat(f.fontSize) || 0;
252
+ const f = getComputedStyle(n), h = parseFloat(f.fontSize) || 0;
252
253
  if (h <= 0) return;
253
- const m = Ut();
254
+ const m = Xt();
254
255
  if (!m) {
255
256
  qe(h * de), Fe(0);
256
257
  return;
257
258
  }
258
259
  m.font = `${f.fontStyle} ${f.fontWeight} ${h}px ${f.fontFamily}`;
259
- const C = m.measureText("H"), T = C.actualBoundingBoxAscent > 0 ? C.actualBoundingBoxAscent : h * de, B = Math.max(0, C.actualBoundingBoxDescent || 0), E = C.fontBoundingBoxAscent || 0, M = C.fontBoundingBoxDescent || 0;
260
+ const S = m.measureText("H"), T = S.actualBoundingBoxAscent > 0 ? S.actualBoundingBoxAscent : h * de, B = Math.max(0, S.actualBoundingBoxDescent || 0), E = S.fontBoundingBoxAscent || 0, C = S.fontBoundingBoxDescent || 0;
260
261
  qe((p) => Math.abs(p - T) > 0.5 ? T : p);
261
- const A = E > 0 || M > 0 ? (M - B - (E - T)) / 2 : 0;
262
+ const A = E > 0 || C > 0 ? (C - B - (E - T)) / 2 : 0;
262
263
  Fe((p) => Math.abs(p - A) > 0.25 ? A : p);
263
264
  };
264
265
  i();
265
- const n = typeof document < "u" ? document.fonts : void 0;
266
- (v = n == null ? void 0 : n.ready) == null || v.then(i).catch(() => {
266
+ const t = typeof document < "u" ? document.fonts : void 0;
267
+ (v = t == null ? void 0 : t.ready) == null || v.then(i).catch(() => {
267
268
  });
268
269
  const b = new ResizeObserver(i);
269
- return b.observe(t), () => b.disconnect();
270
+ return b.observe(n), () => b.disconnect();
270
271
  }, [z.fontFamily, z.fontWeight, z.fontStyle, z.fontSize, z.lineHeight]), W(() => {
271
272
  if (!D) return;
272
- const t = ae.current, i = se.current;
273
- if (!t || !i) return;
274
- const n = { id: 0 }, b = () => {
275
- const m = t.offsetWidth || t.getBoundingClientRect().width, C = i.offsetWidth || i.getBoundingClientRect().width;
276
- if (P && m > 0 && C > 0) {
277
- const T = C / X;
273
+ const n = ae.current, i = se.current;
274
+ if (!n || !i) return;
275
+ const t = { id: 0 }, b = () => {
276
+ const m = n.offsetWidth || n.getBoundingClientRect().width, S = i.offsetWidth || i.getBoundingClientRect().width;
277
+ if (P && m > 0 && S > 0) {
278
+ const T = S / X;
278
279
  if (T > 0) {
279
- let B = m, E = Nt;
280
+ let B = m, E = Bt;
280
281
  if (y) {
281
- const A = m * xe.current, p = ye.current, V = p > 0 ? 2 * Math.PI * p / m : 0, _ = Yt(A, V);
282
- B = Math.max(m, _ * m / (Ge - 1)), E = Bt;
282
+ const A = m * xe.current, p = ye.current, V = p > 0 ? 2 * Math.PI * p / m : 0, _ = Kt(A, V);
283
+ B = Math.max(m, _ * m / (Ge - 1)), E = Ht;
283
284
  }
284
- const M = Math.min(
285
+ const C = Math.min(
285
286
  E,
286
287
  Math.max(Se, Math.ceil(B / T) + 1)
287
288
  );
288
- if (M !== X) {
289
- Ne(M);
289
+ if (C !== X) {
290
+ Ne(C);
290
291
  return;
291
292
  }
292
293
  }
293
294
  }
294
- C > 0 && c(C);
295
+ S > 0 && c(S);
295
296
  }, v = () => {
296
- cancelAnimationFrame(n.id), n.id = requestAnimationFrame(b);
297
+ cancelAnimationFrame(t.id), t.id = requestAnimationFrame(b);
297
298
  };
298
299
  v();
299
300
  const f = new ResizeObserver(v);
300
- f.observe(t), f.observe(i);
301
+ f.observe(n), f.observe(i);
301
302
  const h = () => {
302
303
  document.hidden || v();
303
304
  };
304
305
  return document.addEventListener("visibilitychange", h), window.addEventListener("pageshow", h), window.addEventListener("focus", h), () => {
305
- cancelAnimationFrame(n.id), f.disconnect(), document.removeEventListener("visibilitychange", h), window.removeEventListener("pageshow", h), window.removeEventListener("focus", h);
306
+ cancelAnimationFrame(t.id), f.disconnect(), document.removeEventListener("visibilitychange", h), window.removeEventListener("pageshow", h), window.removeEventListener("focus", h);
306
307
  };
307
308
  }, [D, ce, X, P, U, y, I, K]), W(() => {
308
- const t = ke.current;
309
- if (!t) return;
310
- const i = { id: 0 }, n = () => {
311
- const v = t.offsetHeight;
309
+ const n = ke.current;
310
+ if (!n) return;
311
+ const i = { id: 0 }, t = () => {
312
+ const v = n.offsetHeight;
312
313
  v > 0 && it((f) => Math.abs(f - v) > 0.5 ? v : f);
313
314
  };
314
- i.id = requestAnimationFrame(n);
315
+ i.id = requestAnimationFrame(t);
315
316
  const b = new ResizeObserver(() => {
316
- cancelAnimationFrame(i.id), i.id = requestAnimationFrame(n);
317
+ cancelAnimationFrame(i.id), i.id = requestAnimationFrame(t);
317
318
  });
318
- return b.observe(t), () => {
319
+ return b.observe(n), () => {
319
320
  cancelAnimationFrame(i.id), b.disconnect();
320
321
  };
321
322
  }, [re, o]), W(() => {
@@ -323,28 +324,28 @@ const Wt = 30, Se = 3, Nt = 12, Bt = 96, Ge = 3, de = 0.72, Ht = 100, Ot = 10, z
323
324
  Te(0), _e(0);
324
325
  return;
325
326
  }
326
- const t = ae.current, i = se.current;
327
- if (!t || !i) return;
328
- const n = { id: 0 }, b = () => {
329
- const f = t.offsetWidth, h = i.offsetHeight;
327
+ const n = ae.current, i = se.current;
328
+ if (!n || !i) return;
329
+ const t = { id: 0 }, b = () => {
330
+ const f = n.offsetWidth, h = i.offsetHeight;
330
331
  f > 0 && _e((m) => Math.abs(m - f) > 0.5 ? f : m), h > 0 && Te((m) => Math.abs(m - h) > 0.5 ? h : m);
331
332
  };
332
- n.id = requestAnimationFrame(b);
333
+ t.id = requestAnimationFrame(b);
333
334
  const v = new ResizeObserver(() => {
334
- cancelAnimationFrame(n.id), n.id = requestAnimationFrame(b);
335
+ cancelAnimationFrame(t.id), t.id = requestAnimationFrame(b);
335
336
  });
336
- return v.observe(t), v.observe(i), () => {
337
- cancelAnimationFrame(n.id), v.disconnect();
337
+ return v.observe(n), v.observe(i), () => {
338
+ cancelAnimationFrame(t.id), v.disconnect();
338
339
  };
339
340
  }, [y, ce, U, F, D]), W(() => {
340
341
  if (!D || l <= 0) return;
341
- const t = ve.current;
342
- t && Dt(t);
342
+ const n = ve.current;
343
+ n && It(n);
343
344
  }, [D, l, u, ie]), W(() => {
344
345
  if (!y || !P) return;
345
- const t = ae.current;
346
- if (!t) return;
347
- const i = typeof IntersectionObserver < "u", n = {
346
+ const n = ae.current;
347
+ if (!n) return;
348
+ const i = typeof IntersectionObserver < "u", t = {
348
349
  raf: 0,
349
350
  cancelled: !1,
350
351
  isOnScreen: !i,
@@ -353,69 +354,69 @@ const Wt = 30, Se = 3, Nt = 12, Bt = 96, Ge = 3, de = 0.72, Ht = 100, Ot = 10, z
353
354
  itemsCache: [],
354
355
  cacheDirty: !0
355
356
  }, b = () => {
356
- for (const M of n.itemsCache)
357
- for (const A of M.glyphs) Je(A.inner);
357
+ for (const C of t.itemsCache)
358
+ for (const A of C.glyphs) Je(A.inner);
358
359
  }, v = () => {
359
- const M = ge.current ?? t;
360
- n.itemsCache = Array.from(
361
- t.querySelectorAll("[data-marquee-text-item]"),
360
+ const C = ge.current ?? n;
361
+ t.itemsCache = Array.from(
362
+ n.querySelectorAll("[data-marquee-text-item]"),
362
363
  (A) => {
363
364
  const p = [];
364
365
  return A.querySelectorAll("[data-marquee-wave-node]").forEach((V) => {
365
366
  const _ = V.firstElementChild;
366
367
  _ && p.push({
367
368
  inner: _,
368
- layoutLocalX: jt(V, M)
369
+ layoutLocalX: Yt(V, C)
369
370
  });
370
371
  }), { item: A, glyphs: p };
371
372
  }
372
- ), n.cacheDirty = !1;
373
+ ), t.cacheDirty = !1;
373
374
  }, f = () => {
374
- n.cacheDirty && v();
375
- const A = (ge.current ?? t).offsetWidth || 1, p = A * xe.current, V = ye.current, _ = 2 * Math.PI * V / A, Ue = `${A}|${p}|${_}`;
376
- if (Ue !== n.lutKey && (n.lutKey = Ue, n.lut = et(p, _, Ze)), Math.abs(p) <= 0 || _ <= 0) {
375
+ t.cacheDirty && v();
376
+ const A = (ge.current ?? n).offsetWidth || 1, p = A * xe.current, V = ye.current, _ = 2 * Math.PI * V / A, Ue = `${A}|${p}|${_}`;
377
+ if (Ue !== t.lutKey && (t.lutKey = Ue, t.lut = et(p, _, Ze)), Math.abs(p) <= 0 || _ <= 0) {
377
378
  b();
378
379
  return;
379
380
  }
380
- const Xe = ve.current, bt = Xe ? Vt(getComputedStyle(Xe).transform) : 0, Ve = t.getBoundingClientRect(), wt = Ve.left, $t = Ve.right, At = n.lut && n.lut.wavelength > 0 ? Math.max(0, (n.lut.periodArc / n.lut.wavelength - 1) * A) : 0;
381
- for (const { item: St, glyphs: je } of n.itemsCache) {
381
+ const Xe = ve.current, bt = Xe ? jt(getComputedStyle(Xe).transform) : 0, Ve = n.getBoundingClientRect(), wt = Ve.left, $t = Ve.right, At = t.lut && t.lut.wavelength > 0 ? Math.max(0, (t.lut.periodArc / t.lut.wavelength - 1) * A) : 0;
382
+ for (const { item: St, glyphs: je } of t.itemsCache) {
382
383
  const Ye = St.getBoundingClientRect();
383
384
  if (Ye.right < wt || Ye.left > $t + At) {
384
385
  for (const le of je) Je(le.inner);
385
386
  continue;
386
387
  }
387
388
  for (const le of je) {
388
- const Ae = le.layoutLocalX + bt, Ke = n.lut ? Kt(n.lut, Ae) : Ae, Qe = _ * Ke, Ct = p * Math.sin(Qe), Mt = p * _ * Math.cos(Qe), kt = Math.atan(Mt) * (180 / Math.PI);
389
- Xt(le.inner, Ke - Ae, Ct, kt);
389
+ const Ae = le.layoutLocalX + bt, Ke = t.lut ? Qt(t.lut, Ae) : Ae, Qe = _ * Ke, Ct = p * Math.sin(Qe), Mt = p * _ * Math.cos(Qe), kt = Math.atan(Mt) * (180 / Math.PI);
390
+ Vt(le.inner, Ke - Ae, Ct, kt);
390
391
  }
391
392
  }
392
393
  }, h = () => {
393
- n.cancelled || (n.raf = 0, f(), Re.current && n.isOnScreen && !document.hidden && (n.raf = requestAnimationFrame(h)));
394
+ t.cancelled || (t.raf = 0, f(), Re.current && t.isOnScreen && !document.hidden && (t.raf = requestAnimationFrame(h)));
394
395
  }, m = () => {
395
- n.cancelled || n.raf || !n.isOnScreen || (n.raf = requestAnimationFrame(h));
396
- }, C = () => {
397
- cancelAnimationFrame(n.raf), n.raf = 0;
396
+ t.cancelled || t.raf || !t.isOnScreen || (t.raf = requestAnimationFrame(h));
397
+ }, S = () => {
398
+ cancelAnimationFrame(t.raf), t.raf = 0;
398
399
  }, T = () => {
399
- n.cacheDirty = !0, n.isOnScreen && (f(), m());
400
+ t.cacheDirty = !0, t.isOnScreen && (f(), m());
400
401
  };
401
402
  G.current = m, J.current = T, f(), m();
402
- const B = i ? Tt(t, "0px", (M) => {
403
- n.isOnScreen = M, M ? T() : C();
403
+ const B = i ? _t(n, "0px", (C) => {
404
+ t.isOnScreen = C, C ? T() : S();
404
405
  }) : null, E = () => {
405
- C(), document.hidden || T();
406
+ S(), document.hidden || T();
406
407
  };
407
408
  return document.addEventListener("visibilitychange", E), window.addEventListener("pageshow", E), window.addEventListener("focus", E), () => {
408
- n.cancelled = !0, G.current = null, J.current = null, B == null || B(), cancelAnimationFrame(n.raf), document.removeEventListener("visibilitychange", E), window.removeEventListener("pageshow", E), window.removeEventListener("focus", E), b();
409
+ t.cancelled = !0, G.current = null, J.current = null, B == null || B(), cancelAnimationFrame(t.raf), document.removeEventListener("visibilitychange", E), window.removeEventListener("pageshow", E), window.removeEventListener("focus", E), b();
409
410
  };
410
411
  }, [y, P]), W(() => {
411
- var t;
412
- !y || !P || (t = J.current) == null || t.call(J);
412
+ var n;
413
+ !y || !P || (n = J.current) == null || n.call(J);
413
414
  }, [y, P, d, ce, X, U, I, K, Z]), W(() => {
414
- var t;
415
- (t = G.current) == null || t.call(G);
415
+ var n;
416
+ (n = G.current) == null || n.call(G);
416
417
  }, [pe, u]);
417
- const ct = (t) => {
418
- fe && t.pointerType === "mouse" && Me(!0);
418
+ const ct = (n) => {
419
+ fe && n.pointerType === "mouse" && Me(!0);
419
420
  }, lt = () => {
420
421
  fe && Me(!1);
421
422
  }, Be = y ? Math.abs(I) * 100 : 0, be = oe(re), ut = {
@@ -427,7 +428,7 @@ const Wt = 30, Se = 3, Nt = 12, Bt = 96, Ge = 3, de = 0.72, Ht = 100, Ot = 10, z
427
428
  }, He = {
428
429
  gap: oe(x),
429
430
  minHeight: be
430
- }, Oe = Z * I, ze = Math.abs(Oe), we = We > 0 ? We : Le, $e = Math.max(Le, we), mt = ze + $e / 2, ft = Math.max(we, 1), Pe = y && Z > 0 && $e > 0 ? Qt(
431
+ }, Oe = Z * I, ze = Math.abs(Oe), we = We > 0 ? We : Le, $e = Math.max(Le, we), mt = ze + $e / 2, ft = Math.max(we, 1), Pe = y && Z > 0 && $e > 0 ? Gt(
431
432
  Z,
432
433
  Oe,
433
434
  K,
@@ -455,10 +456,10 @@ const Wt = 30, Se = 3, Nt = 12, Bt = 96, Ge = 3, de = 0.72, Ht = 100, Ot = 10, z
455
456
  ) : null, gt = /* @__PURE__ */ g("div", { ref: ke, className: `${a}-ribbon`, style: dt, "aria-hidden": !0 }), vt = {
456
457
  ...z,
457
458
  lineHeight: U > 0 ? `${U}px` : `${de}em`
458
- }, De = (t, i, n) => /* @__PURE__ */ g(
459
- Gt,
459
+ }, De = (n, i, t) => /* @__PURE__ */ g(
460
+ Jt,
460
461
  {
461
- item: t,
462
+ item: n,
462
463
  prefix: a,
463
464
  textCss: vt,
464
465
  capHeightPx: U,
@@ -466,7 +467,7 @@ const Wt = 30, Se = 3, Nt = 12, Bt = 96, Ge = 3, de = 0.72, Ht = 100, Ot = 10, z
466
467
  imageGapPx: oe(x),
467
468
  isCurve: y
468
469
  },
469
- `${i}-${n}`
470
+ `${i}-${t}`
470
471
  ), xt = /* @__PURE__ */ g("span", { ref: Ee, "aria-hidden": !0, className: `${a}-cap-ref`, style: z, children: "H" }), Ie = `${Math.max(0, rt) / 1e3}s`, yt = D ? /* @__PURE__ */ g(
471
472
  "div",
472
473
  {
@@ -481,14 +482,14 @@ const Wt = 30, Se = 3, Nt = 12, Bt = 96, Ge = 3, de = 0.72, Ht = 100, Ot = 10, z
481
482
  WebkitAnimationPlayState: he,
482
483
  animationPlayState: he
483
484
  },
484
- children: Array.from({ length: st }, (t, i) => /* @__PURE__ */ g(
485
+ children: Array.from({ length: st }, (n, i) => /* @__PURE__ */ g(
485
486
  "div",
486
487
  {
487
488
  ref: i === 0 ? se : void 0,
488
489
  className: `${a}-marquee-set`,
489
490
  style: { ...He, paddingRight: oe(x) },
490
491
  "aria-hidden": i > 0,
491
- children: at.map((n, b) => De(n, i, b))
492
+ children: at.map((t, b) => De(t, i, b))
492
493
  },
493
494
  `set-${i}`
494
495
  ))
@@ -499,7 +500,7 @@ const Wt = 30, Se = 3, Nt = 12, Bt = 96, Ge = 3, de = 0.72, Ht = 100, Ot = 10, z
499
500
  ref: se,
500
501
  className: Rt(`${a}-marquee-set`, `${a}-marquee-static`),
501
502
  style: He,
502
- children: r == null ? void 0 : r.map((t, i) => De(t, 0, i))
503
+ children: r == null ? void 0 : r.map((n, i) => De(n, 0, i))
503
504
  }
504
505
  );
505
506
  return /* @__PURE__ */ Ce("div", { ref: ae, className: `${a}-wrapper`, "aria-label": "Marquee text", children: [
@@ -513,5 +514,5 @@ const Wt = 30, Se = 3, Nt = 12, Bt = 96, Ge = 3, de = 0.72, Ht = 100, Ot = 10, z
513
514
  ] });
514
515
  };
515
516
  export {
516
- an as MarqueeText
517
+ cn as MarqueeText
517
518
  };