{"version":3,"file":"TimeToRead.Cmk7Uduc.mjs","names":["useMemo"],"sources":["https:/framerusercontent.com/modules/HgQVhiwPnXOP1SJ35kJF/tfeDnjcmsKVLl7TNo5e2/TimeToRead.js"],"sourcesContent":["import{jsx as _jsx,jsxs as _jsxs}from\"react/jsx-runtime\";import{addPropertyControls,ControlType}from\"framer\";import{useMemo}from\"react\";function decodeBasicHtmlEntities(input){return input.replace(/&nbsp;/g,\" \").replace(/&amp;/g,\"&\").replace(/&lt;/g,\"<\").replace(/&gt;/g,\">\").replace(/&quot;/g,'\"').replace(/&#39;/g,\"'\");}function extractPlainText(input){if(input==null)return\"\";if(typeof input===\"string\"){const stripped=input.replace(/<[^>]*>/g,\" \");return decodeBasicHtmlEntities(stripped);}if(Array.isArray(input)){return input.map(extractPlainText).join(\" \");}if(typeof input===\"object\"){if(typeof input.text===\"string\")return input.text;if(typeof input.content===\"string\")return input.content;if(Array.isArray(input.children))return extractPlainText(input.children);const values=Object.values(input);if(values.length)return values.map(extractPlainText).join(\" \");}return String(input);}/**\n * @framerIntrinsicWidth 140\n * @framerIntrinsicHeight 24\n *\n * @framerSupportedLayoutWidth any-prefer-fixed\n * @framerSupportedLayoutHeight any-prefer-fixed\n */export default function TimeToRead(props){const{content=\"\",wordsPerMinute=200,prefix=\"\",suffix=\"min read\",textColor=\"#000000\",font={fontSize:\"14px\",variant:\"Regular\",letterSpacing:\"-0.01em\",lineHeight:\"1.2em\"},showIcon=true,iconColor=\"#000000\",iconSize=14,gap=6,style}=props;const minutes=useMemo(()=>{const plainText=extractPlainText(content).replace(/\\s+/g,\" \").trim();const wordCount=plainText?plainText.split(/\\s+/).filter(Boolean).length:0;const wpm=Math.max(1,Number(wordsPerMinute)||200);return wordCount===0?0:Math.max(1,Math.ceil(wordCount/wpm));},[content,wordsPerMinute]);return /*#__PURE__*/_jsxs(\"div\",{style:{...style,position:\"relative\",display:\"inline-flex\",alignItems:\"center\",gap:showIcon?gap:0,color:textColor,lineHeight:1.2,...font},children:[showIcon&&/*#__PURE__*/_jsxs(\"svg\",{width:iconSize,height:iconSize,viewBox:\"0 0 24 24\",fill:\"none\",stroke:iconColor,strokeWidth:\"2\",strokeLinecap:\"round\",strokeLinejoin:\"round\",style:{flexShrink:0},\"aria-hidden\":\"true\",focusable:\"false\",children:[/*#__PURE__*/_jsx(\"circle\",{cx:\"12\",cy:\"12\",r:\"10\"}),/*#__PURE__*/_jsx(\"polyline\",{points:\"12 6 12 12 16 14\"})]}),/*#__PURE__*/_jsxs(\"span\",{style:{minWidth:\"max-content\"},children:[prefix?`${prefix} `:\"\",minutes,\" \",suffix]})]});}addPropertyControls(TimeToRead,{content:{type:ControlType.RichText,title:\"Content\"},wordsPerMinute:{type:ControlType.Number,title:\"WPM\",defaultValue:200,min:100,max:400,step:10},prefix:{type:ControlType.String,title:\"Prefix\",defaultValue:\"\"},suffix:{type:ControlType.String,title:\"Suffix\",defaultValue:\"min read\"},textColor:{type:ControlType.Color,title:\"Color\",defaultValue:\"#000000\"},font:{type:ControlType.Font,title:\"Font\",controls:\"extended\",defaultFontType:\"sans-serif\",defaultValue:{fontSize:\"14px\",variant:\"Regular\",letterSpacing:\"-0.01em\",lineHeight:\"1.2em\"}},showIcon:{type:ControlType.Boolean,title:\"Show Icon\",defaultValue:true,enabledTitle:\"Show\",disabledTitle:\"Hide\"},iconColor:{type:ControlType.Color,title:\"Icon Color\",defaultValue:\"#000000\",hidden(props){return!props.showIcon;}},iconSize:{type:ControlType.Number,title:\"Icon Size\",defaultValue:14,min:8,max:48,step:1,displayStepper:true,hidden(props){return!props.showIcon;}},gap:{type:ControlType.Number,title:\"Icon Gap\",defaultValue:6,min:0,max:24,step:1,displayStepper:true,hidden(props){return!props.showIcon;}}});\nexport const __FramerMetadata__ = {\"exports\":{\"default\":{\"type\":\"reactComponent\",\"name\":\"TimeToRead\",\"slots\":[],\"annotations\":{\"framerSupportedLayoutHeight\":\"any-prefer-fixed\",\"framerIntrinsicWidth\":\"140\",\"framerSupportedLay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