{"version":3,"file":"TextPop.DITLoT-F.mjs","names":["React.useState","React.useMemo"],"sources":["https:/framerusercontent.com/modules/Ip2QgworRYN1hXZWc7QU/VkdOMWwKeE18zug09qow/TextPop.js"],"sourcesContent":["import{jsx as _jsx,jsxs as _jsxs}from\"react/jsx-runtime\";import*as React from\"react\";import{addPropertyControls,ControlType}from\"framer\";function extractText(value){if(value==null||value===false||value===true)return\"\";if(typeof value===\"string\"||typeof value===\"number\"){return String(value);}if(Array.isArray(value)){return value.map(extractText).join(\"\");}if(/*#__PURE__*/React.isValidElement(value)){return extractText(value.props?.children);}if(typeof value===\"object\"){const anyValue=value;if(anyValue.props?.children){return extractText(anyValue.props.children);}if(anyValue.children){return extractText(anyValue.children);}if(anyValue.text){return extractText(anyValue.text);}if(anyValue.value){return extractText(anyValue.value);}return\"\";}return\"\";}export function HoverSentenceText(props){const{contentSource,cmsContent,manualContent,fontFamily,fontSize,lineHeight,fontWeight,baseColor,hoverColor,transitionDuration,easing,hoverBleed,style}=props;const[hoveredIndex,setHoveredIndex]=React.useState(null);const rawContent=contentSource===\"manual\"?manualContent:cmsContent;const plainText=React.useMemo(()=>{return extractText(rawContent);},[rawContent]);const sentences=React.useMemo(()=>{if(!plainText)return[];return plainText.match(/[^.!?]+[.!?]+[\"')\\]]*|[^.!?]+$/g)||[];},[plainText]);return /*#__PURE__*/_jsx(\"div\",{style:{...style,width:\"100%\",height:\"100%\",overflow:\"visible\",fontFamily,fontSize:`${fontSize}rem`,lineHeight,fontWeight,color:baseColor},children:sentences.map((sentence,index)=>/*#__PURE__*/_jsxs(\"span\",{style:{display:\"inline\",color:hoveredIndex===index?hoverColor:baseColor,transition:`color ${transitionDuration}s ${easing}`,cursor:\"default\",paddingTop:`${hoverBleed}em`,paddingBottom:`${hoverBleed}em`,marginTop:`-${hoverBleed}em`,marginBottom:`-${hoverBleed}em`},onMouseEnter:()=>setHoveredIndex(index),onMouseLeave:()=>setHoveredIndex(null),children:[sentence.trim(),\" \"]},index))});}HoverSentenceText.defaultProps={contentSource:\"cms\",cmsContent:\"This is CMS/bindable content. Set this field to a CMS variable when using a collection.\",manualContent:\"This is manually editable content. Switch Content Source to Manual to use this field.\",fontFamily:\"Inter, sans-serif\",fontSize:1.125,lineHeight:1.5,fontWeight:400,baseColor:\"#111111\",hoverColor:\"#888888\",transitionDuration:.18,easing:\"ease\",hoverBleed:.2};addPropertyControls(HoverSentenceText,{contentSource:{type:ControlType.Enum,title:\"Source\",options:[\"cms\",\"manual\"],optionTitles:[\"CMS Variable\",\"Manual Text\"]},cmsContent:{type:ControlType.String,title:\"CMS Content\",hidden(props){return props.contentSource!==\"cms\";}},manualContent:{type:ControlType.RichText,title:\"Manual Content\",hidden(props){return props.contentSource!==\"manual\";}},fontFamily:{type:ControlType.String,title:\"Font\"},fontSize:{type:ControlType.Number,title:\"Size\",min:.5,max:6,step:.025,unit:\"rem\"},lineHeight:{type:ControlType.Number,title:\"Line Height\",min:.8,max:3,step:.05},fontWeight:{type:ControlType.Enum,title:\"Weight\",options:[300,400,500,600,700,800],optionTitles:[\"300\",\"400\",\"500\",\"600\",\"700\",\"800\"]},baseColor:{type:ControlType.Color,title:\"Base Color\"},hoverColor:{type:ControlType.Color,title:\"Hover Color\"},transitionDuration:{type:ControlType.Number,title:\"Duration\",min:0,max:2,step:.01,unit:\"s\"},easing:{type:ControlType.Enum,title:\"Easing\",options:[\"linear\",\"ease\",\"ease-in\",\"ease-out\",\"ease-in-out\",\"cubic-bezier(0.16, 1, 0.3, 1)\",\"cubic-bezier(0.76, 0, 0.24, 1)\"],optionTitles:[\"Linear\",\"Ease\",\"Ease In\",\"Ease Out\",\"Ease In Out\",\"Smooth Out\",\"Sharp\"]},hoverBleed:{type:ControlType.Number,title:\"Hover Bleed\",min:0,max:1,step:.025}});\nexport const __FramerMetadata__ = {\"exports\":{\"HoverSentenceText\":{\"type\":\"reactComponent\",\"name\":\"HoverSentenceText\",\"slots\":[],\"annotations\":{\"framerContractVersion\":\"1\"}},\"__Fram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