@cntrl-site/components 1.0.104 → 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 (99) 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/Components/utils/observeIntersection.d.ts +4 -0
  17. package/dist/Components/utils/useLazyVideos.d.ts +0 -3
  18. package/dist/{ControlSlider-SiOt22l_.js → ControlSlider-Kkec-i14.js} +1 -1
  19. package/dist/{ControlSlider-pZv7H6BU.mjs → ControlSlider-LcZmviGX.mjs} +1 -1
  20. package/dist/EmbedMediaFrame-DsOTKE4i.js +1 -0
  21. package/dist/EmbedMediaFrame-DwHeOAy5.mjs +164 -0
  22. package/dist/{FAQ-C7823fyi.js → FAQ-BxhMo7T8.js} +1 -1
  23. package/dist/{FAQ-CZ39u4m8.mjs → FAQ-CdwSft5p.mjs} +1 -1
  24. package/dist/Grid-CFHTP3mb.js +378 -0
  25. package/dist/Grid-e-gLfsji.mjs +1590 -0
  26. package/dist/Helix-BpLo9FD3.js +43 -0
  27. package/dist/Helix-CidI3ucE.mjs +324 -0
  28. package/dist/{Hive-BusARSOi.mjs → Hive-BsmFHk2i.mjs} +505 -475
  29. package/dist/Hive-D1j6wZpV.js +321 -0
  30. package/dist/ImageRevealSlider-BuukTGAK.js +1 -0
  31. package/dist/{ImageRevealSlider-BdFGyVEP.mjs → ImageRevealSlider-Df9sygk9.mjs} +63 -70
  32. package/dist/{LazyVideo-D8eVYFyw.mjs → LazyVideo-CdAWymKO.mjs} +1 -1
  33. package/dist/{LazyVideo-Cn_vmMq8.js → LazyVideo-imbU18js.js} +1 -1
  34. package/dist/{Lightbox-eP9qAZzL.mjs → Lightbox-C_fXsfdz.mjs} +1 -1
  35. package/dist/{Lightbox-CIss_nOG.js → Lightbox-DaunVrkp.js} +1 -1
  36. package/dist/LinkWrapper-Ca84iPtg.js +1 -0
  37. package/dist/LinkWrapper-DZs9hlOn.mjs +13 -0
  38. package/dist/{List-DW7fyJbf.mjs → List-Bh_-l9vD.mjs} +532 -520
  39. package/dist/List-DVvpQ24J.js +377 -0
  40. package/dist/Marquee-DByooiWP.mjs +578 -0
  41. package/dist/Marquee-DfIP-tIN.js +133 -0
  42. package/dist/MarqueeText-D6FNCe6P.mjs +518 -0
  43. package/dist/MarqueeText-DsUiV6Zv.js +132 -0
  44. package/dist/Mercury-B-s2Kvuq.js +267 -0
  45. package/dist/Mercury-CCW0Es-s.mjs +1700 -0
  46. package/dist/PretextComponent-Dnbenstn.js +1 -0
  47. package/dist/{PretextComponent-s4DDfmzY.mjs → PretextComponent-OygSO3fr.mjs} +312 -269
  48. package/dist/{RichTextRenderer-B6WtTYlR.mjs → RichTextRenderer-BptwNpbJ.mjs} +10 -9
  49. package/dist/RichTextRenderer-K90Dd7pt.js +1 -0
  50. package/dist/{Slider20-Dm8BeCli.mjs → Slider20-CCzixTiN.mjs} +1 -1
  51. package/dist/{Slider20-C9o2REDl.js → Slider20-fMVeRfgx.js} +1 -1
  52. package/dist/{TestimonialGrid-CPu4qQ6B.mjs → TestimonialGrid-CbsVxSn9.mjs} +1 -1
  53. package/dist/{TestimonialGrid-D4ieiz9e.js → TestimonialGrid-CiCagfBU.js} +1 -1
  54. package/dist/{TestimonialSingle-DLdnAVF7.mjs → TestimonialSingle-BVm3Amrl.mjs} +1 -1
  55. package/dist/{TestimonialSingle-CVu15ZtV.js → TestimonialSingle-BWXynGjv.js} +1 -1
  56. package/dist/Waterfall-3kKioKh2.mjs +1432 -0
  57. package/dist/Waterfall-DII4-WV5.js +288 -0
  58. package/dist/{components-Yf9Zjska.mjs → components-BRmbflgg.mjs} +15 -15
  59. package/dist/components-nvbH4l0S.js +1 -0
  60. package/dist/content/postFieldBindings.d.ts +29 -0
  61. package/dist/elements.js +1 -1
  62. package/dist/elements.mjs +16 -16
  63. package/dist/elements.node.js +1 -1
  64. package/dist/elements.node.mjs +1 -1
  65. package/dist/index.d.ts +3 -1
  66. package/dist/index.js +1 -1
  67. package/dist/index.mjs +52 -15
  68. package/dist/observeIntersection-B0f3L2iK.mjs +23 -0
  69. package/dist/observeIntersection-DxGj9Ctt.js +1 -0
  70. package/dist/sources.js +335 -223
  71. package/dist/sources.mjs +339 -227
  72. package/dist/types/SchemaV1.d.ts +53 -1
  73. package/dist/useLazyVideos-CdCbc2j0.js +1 -0
  74. package/dist/useLazyVideos-CxXyEjRQ.mjs +52 -0
  75. package/dist/utils.js +1 -1
  76. package/dist/utils.mjs +30 -20
  77. package/package.json +1 -1
  78. package/dist/ClickGallerie-D7g093HX.js +0 -36
  79. package/dist/ClickGallerie-QSOQjSdv.mjs +0 -271
  80. package/dist/Grid-B2_o1dvz.mjs +0 -1576
  81. package/dist/Grid-Bq6bk2AQ.js +0 -374
  82. package/dist/Helix-B7rxlvKq.js +0 -43
  83. package/dist/Helix-BrKQzGX5.mjs +0 -315
  84. package/dist/Hive-Dh5nKPGm.js +0 -321
  85. package/dist/ImageRevealSlider-BBWtFjUF.js +0 -1
  86. package/dist/List-C32WImI3.js +0 -377
  87. package/dist/Marquee-CdtAqhQE.mjs +0 -563
  88. package/dist/Marquee-DUN8wUax.js +0 -133
  89. package/dist/MarqueeText-4Rip_sQX.mjs +0 -515
  90. package/dist/MarqueeText-E6OubMOG.js +0 -132
  91. package/dist/Mercury-BRqlbk4i.mjs +0 -1702
  92. package/dist/Mercury-C-O2VGkK.js +0 -267
  93. package/dist/PretextComponent-D5P0AjnL.js +0 -1
  94. package/dist/RichTextRenderer-CIy6yI8U.js +0 -1
  95. package/dist/Waterfall-DKuh4bnv.mjs +0 -1404
  96. package/dist/Waterfall-fdiHR0Rc.js +0 -287
  97. package/dist/components-DzNixU7Q.js +0 -1
  98. package/dist/useLazyVideos-BbgdvELi.js +0 -1
  99. package/dist/useLazyVideos-CZLyNolX.mjs +0 -72
@@ -1,132 +0,0 @@
1
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const f=require("react/jsx-runtime"),a=require("react"),wt=require("classnames"),$t=require("./scalingValue-CSHYgTZl.js"),St=require("./useScopedStyles-Bf6yohVQ.js"),At=require("./textStylesToCss-CNN3zZTV.js");function Et(e,r,o){const s=r>0?`${r}px`:"0px",i=o?`
2
- .${e}-item-image-wrap {
3
- display: flex;
4
- flex: 0 0 auto;
5
- align-items: center;
6
- }
7
- .${e}-glyph {
8
- display: inline-block;
9
- }
10
- .${e}-glyph-inner {
11
- display: inline-block;
12
- transform-origin: 50% 50%;
13
- backface-visibility: hidden;
14
- -webkit-backface-visibility: hidden;
15
- }
16
- .${e}-item-image {
17
- transform-origin: 50% 50%;
18
- backface-visibility: hidden;
19
- -webkit-backface-visibility: hidden;
20
- }
21
- `:"";return`
22
- .${e}-wrapper {
23
- position: relative;
24
- width: 100%;
25
- height: auto;
26
- }
27
- .${e}-marquee-wrapper {
28
- position: relative;
29
- overflow: hidden;
30
- overflow-x: clip;
31
- overflow-y: visible;
32
- width: 100%;
33
- height: auto;
34
- }
35
- .${e}-curve-bg {
36
- position: absolute;
37
- left: 0;
38
- top: 0;
39
- width: 100%;
40
- height: 100%;
41
- overflow: visible;
42
- pointer-events: none;
43
- z-index: 0;
44
- }
45
- .${e}-ribbon {
46
- position: absolute;
47
- left: 0;
48
- top: 50%;
49
- width: 100%;
50
- transform: translateY(-50%);
51
- pointer-events: none;
52
- z-index: 0;
53
- }
54
-
55
- @keyframes ${e}-marquee-left {
56
- from { -webkit-transform: translate3d(0, 0, 0); transform: translate3d(0, 0, 0); }
57
- to { -webkit-transform: translate3d(-${s}, 0, 0); transform: translate3d(-${s}, 0, 0); }
58
- }
59
-
60
- @keyframes ${e}-marquee-right {
61
- from { -webkit-transform: translate3d(-${s}, 0, 0); transform: translate3d(-${s}, 0, 0); }
62
- to { -webkit-transform: translate3d(0, 0, 0); transform: translate3d(0, 0, 0); }
63
- }
64
-
65
- .${e}-marquee-track {
66
- display: flex;
67
- flex-direction: row;
68
- width: max-content;
69
- backface-visibility: hidden;
70
- -webkit-backface-visibility: hidden;
71
- flex-wrap: nowrap;
72
- -webkit-animation-timing-function: linear;
73
- animation-timing-function: linear;
74
- -webkit-animation-iteration-count: infinite;
75
- animation-iteration-count: infinite;
76
- position: relative;
77
- z-index: 1;
78
- }
79
- .${e}-marquee-track[data-direction="left"] {
80
- -webkit-animation-name: ${e}-marquee-left;
81
- animation-name: ${e}-marquee-left;
82
- }
83
- .${e}-marquee-track[data-direction="right"] {
84
- -webkit-animation-name: ${e}-marquee-right;
85
- animation-name: ${e}-marquee-right;
86
- }
87
- .${e}-marquee-set {
88
- display: flex;
89
- flex-direction: row;
90
- align-items: center;
91
- flex: 0 0 auto;
92
- position: relative;
93
- z-index: 1;
94
- }
95
- .${e}-marquee-static {
96
- justify-content: center;
97
- overflow-x: auto;
98
- }
99
- .${e}-item {
100
- position: relative;
101
- display: flex;
102
- flex-direction: row;
103
- align-items: center;
104
- flex: 0 0 auto;
105
- white-space: nowrap;
106
- }
107
- .${e}-item-link {
108
- display: flex;
109
- flex-direction: row;
110
- align-items: center;
111
- text-decoration: none;
112
- color: inherit;
113
- }
114
- .${e}-item-image {
115
- display: block;
116
- width: auto;
117
- flex: 0 0 auto;
118
- object-fit: contain;
119
- }
120
- .${e}-text {
121
- display: inline-block;
122
- }
123
- ${i}
124
- .${e}-cap-ref {
125
- position: absolute;
126
- visibility: hidden;
127
- pointer-events: none;
128
- white-space: nowrap;
129
- left: -9999px;
130
- top: 0;
131
- }
132
- `}const Mt=30,we=3,Ct=12,Rt=96,Ue=3,se=.72,kt=100,qt=10,Lt=e=>e/kt,Ft=e=>Math.max(0,e)/qt,Tt=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")},_t=(e,r)=>Array.from({length:r*e.length},(o,s)=>e[s%e.length]),D={ctx:void 0},Wt=()=>D.ctx!==void 0?D.ctx:typeof document>"u"?(D.ctx=null,D.ctx):(D.ctx=document.createElement("canvas").getContext("2d"),D.ctx),Nt=(e,r,o,s)=>{e.style.transform=`translate3d(${r}px, ${o}px, 0) rotate(${s}deg)`},Xe=e=>{e.style.transform=""},jt=e=>{if(!e||e==="none")return 0;try{return new DOMMatrixReadOnly(e).m41}catch{return 0}},Bt=(e,r)=>{const o=(s,i)=>{if(!s||s===r)return i;const m=i+s.offsetLeft,u=s.offsetParent;return!u||u===s?m:o(u,m)};return o(e,e.offsetWidth/2)},Ve=96,Ye=(e,r,o)=>{if(r<=0||Math.abs(e)<=0||o<2)return null;const s=2*Math.PI/r,i=new Float64Array(o+1),m=new Float64Array(o+1),u=e*r,l=d=>Math.sqrt(1+(u*Math.cos(r*d))**2),w=s/o;return Array.from({length:o},(d,R)=>{const v=R*w,M=v+w;i[R+1]=M,m[R+1]=m[R]+(l(v)+l(M))*.5*w}),{wavelength:s,periodArc:m[o],x:i,s:m}},Ht=(e,r)=>{const o=Ye(e,r,Ve);return!o||o.wavelength<=0?1:o.periodArc/o.wavelength},Pt=(e,r)=>{if(e.periodArc<=0)return r;const o=r<0?-1:1,s=Math.abs(r),i=Math.floor(s/e.periodArc),m=s-i*e.periodArc,{s:u,x:l}=e,w=(k,$)=>{if($-k<=1)return[k,$];const q=k+$>>1;return u[q]<=m?w(q,$):w(k,q)},[d,R]=w(0,u.length-1),v=u[R]-u[d],M=v>0?(m-u[d])/v:0;return o*(i*e.wavelength+l[d]+(l[R]-l[d])*M)},zt=(e,r,o,s,i=0)=>{const m=Math.max(0,o),u=e>0?2*Math.PI*m/e:0,l=$=>s+r*Math.sin(u*$),w=$=>r*u*Math.cos(u*$),d=-i,v=e+i-d,M=Math.max(4,Math.ceil(m*4*(v/Math.max(e,1)))),k=Array.from({length:M},($,q)=>{const W=d+q/M*v,L=d+(q+1)/M*v,N=L-W,Q=l(W),I=l(L),G=W+N/3,J=Q+w(W)*N/3,ce=L-N/3,Z=I-w(L)*N/3;return`C${G.toFixed(2)} ${J.toFixed(2)} ${ce.toFixed(2)} ${Z.toFixed(2)} ${L.toFixed(2)} ${I.toFixed(2)}`});return[`M${d.toFixed(2)} ${l(d).toFixed(2)}`,...k].join(" ")},Ot=({item:e,prefix:r,textCss:o,capHeightPx:s,opticalOffsetY:i,imageGapPx:m,isCurve:u})=>{var k;const l=i!==0?{...o,transform:`translateY(${i}px)`}:o,w=s>0?{height:`${s}px`}:{fontSize:o.fontSize,height:`${se}em`},d=((k=e.image)==null?void 0:k.assetId)&&f.jsx("img",{src:e.image.assetId,alt:e.image.name??"",className:`${r}-item-image`,style:w}),R=d&&(u?f.jsx("span",{className:`${r}-item-image-wrap`,"data-marquee-wave-node":!0,children:d}):d),v=u?f.jsx("span",{className:`${r}-text`,style:l,children:Array.from(e.text).map(($,q)=>f.jsx("span",{className:`${r}-glyph`,"data-marquee-wave-node":!0,children:f.jsx("span",{className:`${r}-glyph-inner`,children:$===" "?" ":$})},q))}):f.jsx("span",{className:`${r}-text`,style:l,children:e.text}),M=f.jsxs(f.Fragment,{children:[R,v]});return f.jsx("div",{className:`${r}-item`,"data-marquee-text-item":!0,style:{gap:m},children:e.link?f.jsx("a",{href:e.link,className:`${r}-item-link`,style:{gap:m},children:M}):M})},Dt=({settings:e,content:r,isEditor:o,isPreviewMode:s})=>{const{prefix:i}=St.useScopedStyles(),[m,u]=a.useState(0),l=m>0?Math.round(m):0,{speed:w,direction:d,pauseOnHover:R,gap:v,layoutType:M,curveAmplitude:k,curveFrequency:$,textFontFamily:q,textFontSettings:W,textFontSize:L,textLetterSpacing:N,textWordSpacing:Q,textTextAppearance:I,textColor:G,backgroundColor:J,ribbonWidth:ce}=e,Z=ce??L,b=M==="curve",P=Lt(k),U=Ft($),Ke=a.useMemo(()=>Et(i,l,b),[i,l,b]),j=a.useMemo(()=>At.textStylesToCss({fontSettings:{fontFamily:q,fontWeight:W.fontWeight,fontStyle:W.fontStyle},letterSpacing:N,wordSpacing:Q,fontSize:L,lineHeight:L,textAppearance:I,color:G},o),[q,W,N,Q,L,I,G,o]),ee=n=>$t.scalingValue(n,o??!1),B=((r==null?void 0:r.length)??0)>0,X=o?!!s:!0,H=B&&(X||!!o),te=Math.max(0,w)*Mt,ue=X&&R==="on",[Qe,$e]=a.useState(!1),le=X?ue&&Qe?"paused":"running":"paused",de=le==="running"&&te>0&&l>0,Ge=l>0&&te>0?l/te*1e3:0,ne=a.useRef(null),fe=a.useRef(null),me=a.useRef(null),re=a.useRef(null),Se=a.useRef(null),Ae=a.useRef(null),Ee=a.useRef(de),V=a.useRef(null),Y=a.useRef(null),he=a.useRef(P),pe=a.useRef(U);Ee.current=de,he.current=P,pe.current=U;const[z,Me]=a.useState(0),[Je,Ce]=a.useState(0),[Re,ke]=a.useState(0),[K,qe]=a.useState(0),[Le,Ze]=a.useState(0),oe=a.useMemo(()=>(r??[]).map(n=>{var t;return`${n.text}\0${((t=n.image)==null?void 0:t.assetId)??""}\0${n.link??""}`}).join("\0"),[r]),[O,Fe]=a.useState(we),et=a.useMemo(()=>{const n=r??[];return n.length===0||!(X||o)?n:_t(n,O)},[r,X,O,o]),tt=H?Ue:1;a.useLayoutEffect(()=>{Fe(we),u(0)},[oe]),a.useLayoutEffect(()=>{var g;const n=Ae.current;if(!n)return;const t=()=>{const x=getComputedStyle(n),h=parseFloat(x.fontSize)||0;if(h<=0)return;const p=Wt();if(!p){Me(h*se),Ce(0);return}p.font=`${x.fontStyle} ${x.fontWeight} ${h}px ${x.fontFamily}`;const y=p.measureText("H"),F=y.actualBoundingBoxAscent>0?y.actualBoundingBoxAscent:h*se,A=Math.max(0,y.actualBoundingBoxDescent||0),E=y.fontBoundingBoxAscent||0,_=y.fontBoundingBoxDescent||0;Me(T=>Math.abs(T-F)>.5?F:T);const C=E>0||_>0?(_-A-(E-F))/2:0;Ce(T=>Math.abs(T-C)>.25?C:T)};t();const c=typeof document<"u"?document.fonts:void 0;(g=c==null?void 0:c.ready)==null||g.then(t).catch(()=>{});const S=new ResizeObserver(t);return S.observe(n),()=>S.disconnect()},[j.fontFamily,j.fontWeight,j.fontStyle,j.fontSize,j.lineHeight]),a.useLayoutEffect(()=>{if(!H)return;const n=ne.current,t=re.current;if(!n||!t)return;const c={id:0},S=()=>{const p=n.offsetWidth||n.getBoundingClientRect().width,y=t.offsetWidth||t.getBoundingClientRect().width;if(B&&p>0&&y>0){const F=y/O;if(F>0){let A=p,E=Ct;if(b){const C=p*he.current,T=pe.current,ae=T>0?2*Math.PI*T/p:0,ve=Ht(C,ae);A=Math.max(p,ve*p/(Ue-1)),E=Rt}const _=Math.min(E,Math.max(we,Math.ceil(A/F)+1));if(_!==O){Fe(_);return}}}y>0&&u(y)},g=()=>{cancelAnimationFrame(c.id),c.id=requestAnimationFrame(S)};g();const x=new ResizeObserver(g);x.observe(n),x.observe(t);const h=()=>{document.hidden||g()};return document.addEventListener("visibilitychange",h),window.addEventListener("pageshow",h),window.addEventListener("focus",h),()=>{cancelAnimationFrame(c.id),x.disconnect(),document.removeEventListener("visibilitychange",h),window.removeEventListener("pageshow",h),window.removeEventListener("focus",h)}},[H,oe,O,B,z,b,P,U]),a.useLayoutEffect(()=>{const n=Se.current;if(!n)return;const t={id:0},c=()=>{const g=n.offsetHeight;g>0&&Ze(x=>Math.abs(x-g)>.5?g:x)};t.id=requestAnimationFrame(c);const S=new ResizeObserver(()=>{cancelAnimationFrame(t.id),t.id=requestAnimationFrame(c)});return S.observe(n),()=>{cancelAnimationFrame(t.id),S.disconnect()}},[Z,o]),a.useLayoutEffect(()=>{if(!b){ke(0),qe(0);return}const n=ne.current,t=re.current;if(!n||!t)return;const c={id:0},S=()=>{const x=n.offsetWidth,h=t.offsetHeight;x>0&&qe(p=>Math.abs(p-x)>.5?x:p),h>0&&ke(p=>Math.abs(p-h)>.5?h:p)};c.id=requestAnimationFrame(S);const g=new ResizeObserver(()=>{cancelAnimationFrame(c.id),c.id=requestAnimationFrame(S)});return g.observe(n),g.observe(t),()=>{cancelAnimationFrame(c.id),g.disconnect()}},[b,oe,z,L,H]),a.useLayoutEffect(()=>{if(!H||l<=0)return;const n=me.current;n&&Tt(n)},[H,l,d,te]),a.useLayoutEffect(()=>{if(!b||!B)return;const n=ne.current;if(!n)return;const t={raf:0,cancelled:!1,lut:null,lutKey:"",itemsCache:[],cacheDirty:!0},c=()=>{for(const F of t.itemsCache)for(const A of F.glyphs)Xe(A.inner)},S=()=>{const F=fe.current??n;t.itemsCache=Array.from(n.querySelectorAll("[data-marquee-text-item]"),A=>{const E=[];return A.querySelectorAll("[data-marquee-wave-node]").forEach(_=>{const C=_.firstElementChild;C&&E.push({inner:C,layoutLocalX:Bt(_,F)})}),{item:A,glyphs:E}}),t.cacheDirty=!1},g=()=>{t.cacheDirty&&S();const A=(fe.current??n).offsetWidth||1,E=A*he.current,_=pe.current,C=2*Math.PI*_/A,T=`${A}|${E}|${C}`;if(T!==t.lutKey&&(t.lutKey=T,t.lut=Ye(E,C,Ve)),Math.abs(E)<=0||C<=0){c();return}const ae=me.current,ve=ae?jt(getComputedStyle(ae).transform):0,Pe=n.getBoundingClientRect(),ht=Pe.left,pt=Pe.right,gt=t.lut&&t.lut.wavelength>0?Math.max(0,(t.lut.periodArc/t.lut.wavelength-1)*A):0;for(const{item:xt,glyphs:ze}of t.itemsCache){const Oe=xt.getBoundingClientRect();if(Oe.right<ht||Oe.left>pt+gt){for(const ie of ze)Xe(ie.inner);continue}for(const ie of ze){const be=ie.layoutLocalX+ve,De=t.lut?Pt(t.lut,be):be,Ie=C*De,yt=E*Math.sin(Ie),vt=E*C*Math.cos(Ie),bt=Math.atan(vt)*(180/Math.PI);Nt(ie.inner,De-be,yt,bt)}}},x=()=>{t.cancelled||(t.raf=0,g(),Ee.current&&!document.hidden&&(t.raf=requestAnimationFrame(x)))},h=()=>{t.cancelled||t.raf||(t.raf=requestAnimationFrame(x))},p=()=>{t.cacheDirty=!0,g(),h()};V.current=h,Y.current=p,g(),h();const y=()=>{if(document.hidden){cancelAnimationFrame(t.raf),t.raf=0;return}cancelAnimationFrame(t.raf),t.raf=0,p()};return document.addEventListener("visibilitychange",y),window.addEventListener("pageshow",y),window.addEventListener("focus",y),()=>{t.cancelled=!0,V.current=null,Y.current=null,cancelAnimationFrame(t.raf),document.removeEventListener("visibilitychange",y),window.removeEventListener("pageshow",y),window.removeEventListener("focus",y),c()}},[b,B]),a.useLayoutEffect(()=>{var n;!b||!B||(n=Y.current)==null||n.call(Y)},[b,B,m,oe,O,z,P,U,K]),a.useLayoutEffect(()=>{var n;(n=V.current)==null||n.call(V)},[de,d]);const nt=n=>{ue&&n.pointerType==="mouse"&&$e(!0)},rt=()=>{ue&&$e(!1)},Te=b?Math.abs(P)*100:0,ge=ee(Z),ot={minHeight:ge,...b?{paddingTop:`${Te}%`,paddingBottom:`${Te}%`}:{}},at={height:ge,...b?{visibility:"hidden"}:{backgroundColor:J}},_e={gap:ee(v),minHeight:ge},We=K*P,Ne=Math.abs(We),xe=Le>0?Le:Re,ye=Math.max(Re,xe),it=Ne+ye/2,st=Math.max(xe,1),je=b&&K>0&&ye>0?zt(K,We,U,it,st):"",ct=Ne*2+ye,ut=je?f.jsx("svg",{className:`${i}-curve-bg`,viewBox:`0 0 ${K} ${ct}`,preserveAspectRatio:"none","aria-hidden":!0,children:f.jsx("path",{d:je,fill:"none",stroke:J,strokeWidth:xe,strokeLinecap:"butt",strokeLinejoin:"round"})}):null,lt=f.jsx("div",{ref:Se,className:`${i}-ribbon`,style:at,"aria-hidden":!0}),dt={...j,lineHeight:z>0?`${z}px`:`${se}em`},Be=(n,t,c)=>f.jsx(Ot,{item:n,prefix:i,textCss:dt,capHeightPx:z,opticalOffsetY:Je,imageGapPx:ee(v),isCurve:b},`${t}-${c}`),ft=f.jsx("span",{ref:Ae,"aria-hidden":!0,className:`${i}-cap-ref`,style:j,children:"H"}),He=`${Math.max(0,Ge)/1e3}s`,mt=H?f.jsx("div",{ref:me,className:`${i}-marquee-track`,"data-direction":d,onPointerEnter:nt,onPointerLeave:rt,style:{WebkitAnimationDuration:He,animationDuration:He,WebkitAnimationPlayState:le,animationPlayState:le},children:Array.from({length:tt},(n,t)=>f.jsx("div",{ref:t===0?re:void 0,className:`${i}-marquee-set`,style:{..._e,paddingRight:ee(v)},"aria-hidden":t>0,children:et.map((c,S)=>Be(c,t,S))},`set-${t}`))}):f.jsx("div",{ref:re,className:wt(`${i}-marquee-set`,`${i}-marquee-static`),style:_e,children:r==null?void 0:r.map((n,t)=>Be(n,0,t))});return f.jsxs("div",{ref:ne,className:`${i}-wrapper`,"aria-label":"Marquee text",children:[f.jsx("style",{dangerouslySetInnerHTML:{__html:Ke}}),ft,f.jsxs("div",{ref:fe,className:`${i}-marquee-wrapper`,style:ot,children:[lt,ut,mt]})]})};exports.MarqueeText=Dt;