{
  "version": 3,
  "sources": ["ssg:https://framerusercontent.com/modules/7jH20PWPnnIXr56zw6ZI/6uyD7c2NXQBicA39gxbm/RichTextCounter.js"],
  "sourcesContent": ["import{jsx as _jsx}from\"react/jsx-runtime\";import{addPropertyControls,ControlType}from\"framer\";import{fontControls}from\"https://framer.com/m/framer/default-utils.js@^0.45.0\";import{useEffect,useState}from\"react\";export function WordCounter(props){const{font,fontColor,title,displayMode}=props;const[countWords,setCountWords]=useState(0);useEffect(()=>{if(typeof window===\"undefined\")return;// Check if running in a browser environment\nconst div=document.createElement(\"div\");div.innerHTML=typeof title===\"string\"?title:JSON.stringify(title);const text=div.textContent||div.innerText||\"\";setCountWords(text.trim().split(/\\s+/).length);},[title]);const wordsPerMinute=200// Average reading speed\n;const timeToRead=Math.ceil(countWords/wordsPerMinute);return /*#__PURE__*/_jsx(\"div\",{style:{...font,color:fontColor,display:\"flex\",justifyContent:\"center\",alignItems:\"center\",padding:0},children:displayMode===\"words\"?`${countWords}`:`${timeToRead} Min. Lesezeit`});}WordCounter.defaultProps={title:\"<p>Your rich text here</p>\",font:fontControls.defaultProps,fontColor:\"#000\",displayMode:\"words\"};addPropertyControls(WordCounter,{title:{title:\"Title\",//@ts-ignore\ntype:ControlType.RichText},font:{// @ts-expect-error \u2013\u00A0Internal\ntype:ControlType.Font,controls:\"extended\",title:\"Font\"},fontColor:{title:\"Font Color\",type:ControlType.Color,defaultValue:WordCounter.defaultProps.fontColor},displayMode:{title:\"Display Mode\",type:ControlType.SegmentedEnum,options:[\"words\",\"time\"],optionTitles:[\"Words\",\"Lesezeit\"],defaultValue:WordCounter.defaultProps.displayMode,description:\"[via SegmentUI](https://www.segmentUI.com)\"}});\nexport const __FramerMetadata__ = {\"exports\":{\"WordCounter\":{\"type\":\"reactComponent\",\"name\":\"WordCounter\",\"slots\":[],\"annotations\":{\"framerContractVersion\":\"1\"}},\"__FramerMetadata__\":{\"type\":\"variable\"}}}\n//# sourceMappingURL=./RichTextCounter.map"],
  "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timeToRead", "p", "fontControls", "addPropertyControls", "ControlType"]
}
