import{t as e}from"./rolldown-runtime.Bi-D_2cA.mjs";import{E as t,T as n,_ as r,l as i,o as a,s as o}from"./react.D2mjVV6P.mjs";import{t as s,w as c}from"./motion.BOE6NzJ0.mjs";import{D as l,G as u,o as d}from"./framer.DNJzXnxj.mjs";function f({text:e,transition:t,stagger:o,reverse:s,font:l,color:u,textTransform:d,tag:f,padding:p}){let[m,h]=r(!1),g=`rolling-text-inner-${n().replace(/:/g,``)}`,_=f,v=l?.fontSize??`16px`;l?.letterSpacing;let y=l?.lineHeight,b=l?.fontFamily??`Inter`,x=parseInt(v,10)||16,S;if(typeof y==`number`)S=x*y;else if(typeof y==`string`&&y.includes(`em`))S=x*(parseFloat(y)||1.2);else if(typeof y==`string`){let e=parseFloat(y);S=isNaN(e)?y:`${e}px`}else S=x*1.2;let C=typeof S==`number`?`${S}px`:S,w=`-${C}`,T={left:`flex-start`,center:`center`,right:`flex-end`}[l?.textAlign]??`center`,{textAlign:E,...D}=l??{},O=` .${g} { --font-size: ${v}; --text: ${u}; --line-height-abs: ${C}; box-sizing: border-box; margin: 0; padding: 0; vertical-align: top; display: flex; overflow: hidden; width: max-content; font-family: ${b}; font-size: ${v}; text-transform: ${d}; user-select: none; text-shadow: 0 var(--line-height-abs) 0 var(--text); } .${g} span { display: block; -webkit-backface-visibility: hidden; backface-visibility: hidden; white-space: pre; flex-shrink: 0; font-family: inherit; font-weight: inherit; font-style: inherit; font-size: inherit; letter-spacing: inherit; line-height: ${y??1.2}; color: var(--text); } `,k={display:`flex`,alignItems:`center`,justifyContent:T,width:`100%`,height:`100%`,overflow:`hidden`,padding:p,boxSizing:`border-box`},A={initial:{y:`0%`},hover:{y:w}},j=typeof t?.duration==`number`?t.duration:.5,M=o/100;return/*#__PURE__*/ i(`div`,{style:k,onMouseEnter:()=>h(!0),onMouseLeave:()=>h(!1),children:[/*#__PURE__*/ a(_,{className:g,children:[...e].map((n,r)=>{let i=s?e.length-1-r:r,o=e.length>0?j/e.length*i*M:0,l={display:`block`,...D};return/*#__PURE__*/ a(c.span,{variants:A,initial:`initial`,animate:m?`hover`:`initial`,transition:{...t,delay:o},style:l,children:n===` `?`\xA0`:n},r)})}),/*#__PURE__*/ a(`style`,{children:O})]})}function p(){return(p=e((()=>{o(),t(),u(),s(),f.displayName=`Rolling Text`,l(f,{text:{type:d.String,title:`Text`,defaultValue:`Rolling Text`},font:{type:d.Font,title:`Font`,controls:`extended`,defaultValue:{fontFamily:`Inter`,fontWeight:`400`,fontSize:`16px`,fontStyle:`normal`,letterSpacing:`0px`,lineHeight:1.2}},color:{type:d.Color,title:`Color`,defaultValue:`#808080`},transition:{type:d.Transition,title:`Transition`,defaultValue:{type:`spring`,duration:.4,bounce:0}},stagger:{title:`Stagger`,type:d.Number,min:0,max:100,step:1,defaultValue:35,unit:`%`},padding:{title:`Padding`,type:d.Padding,defaultValue:`0px`},reverse:{type:d.Boolean,title:`Reverse`,defaultValue:!1,enabledTitle:`Yes`,disabledTitle:`No`},textTransform:{title:`Transform`,type:d.Enum,defaultValue:`none`,options:[`none`,`uppercase`,`lowercase`,`capitalize`],optionTitles:[`None`,`Uppercase`,`Lowercase`,`Capitalize`]},tag:{type:d.Enum,title:`Tag`,options:[`p`,`span`,`h1`,`h2`,`h3`,`h4`,`h5`,`h6`],optionTitles:[`p`,`span`,`h1`,`h2`,`h3`,`h4`,`h5`,`h6`],defaultValue:`p`,description:`More components at [Framer University](https://frameruni.link/cc).`}})})))()}export{p as n,f as t}; //# sourceMappingURL=RollingTextHover_Prod.CesLcrOt.mjs.map