{"version":3,"file":"ReadingTime.DOPE7ADZ.mjs","names":[],"sources":["https:/framerusercontent.com/modules/L21oPRpPlLtefnrR8aCf/OT7lHvuQR6vUbRFwvHcP/ReadingTime.js"],"sourcesContent":["/**\n * Reading Time V1\n * By Matias Fernandez\n *\n * at mattimelgarejo\n *\n *\n *\n */import{jsxs as _jsxs}from\"react/jsx-runtime\";import{addPropertyControls,ControlType}from\"framer\";/**\n * @framerDisableUnlink\n */export default function ReadingTime(props){const{text,readingType,language,style,textColor}=props;const calculateReadingTime=(text,readingType)=>{let wordsPerMinute;if(readingType===\"Talk Time\"){wordsPerMinute=200// Palabras por minuto durante el discurso\n;}else{wordsPerMinute=300// Palabras por minuto durante la lectura en silencio\n;}if(!text)return 0// Si no hay texto, retornar 0 minutos\n;const words=text.trim().split(/\\s+/).length;const readingTime=Math.ceil(words/wordsPerMinute);return readingTime;};const readingTime=calculateReadingTime(text,readingType);const minutesText=language===\"English\"?readingTime===1?\"minute\":\"minutes\":readingTime===1?\"minuto\":\"minutos\";return /*#__PURE__*/_jsxs(\"p\",{style:{...props.style,color:props.textColor,margin:0},children:[readingTime,\" \",minutesText]});}ReadingTime.defaultProps={text:\"\",readingType:\"Talk Time\",language:\"English\"};addPropertyControls(ReadingTime,{text:{type:ControlType.String,title:\"Text\",defaultValue:\"\",placeholder:\"Write or paste your text here...\",displayTextArea:true,hidden(props){return props.displayTextArea===false;}},readingType:{type:ControlType.Enum,title:\"Reading type\",options:[\"Talk Time\",\"Silent Reading Time\"],defaultValue:\"Talk Time\",description:\"Talk Time: 200 wpm / Silent Reading Time: 300 wpm\"},language:{type:ControlType.Enum,title:\"Language\",options:[\"English\",\"Spanish\"],defaultValue:\"English\",displaySegmentedControl:true},style:{type:ControlType.Font,title:\"Style\",controls:\"extended\",displayTextAlignment:false},textColor:{title:\"Color\",type:ControlType.Color,defaultValue:\"#000\",description:\"More components and templates [here](http://kavajuresa.xyz/).\"}});\nexport const __FramerMetadata__ = {\"exports\":{\"default\":{\"type\":\"reactComponent\",\"name\":\"ReadingTime\",\"slots\":[],\"annotations\":{\"framerContractVersion\":\"1\",\"framerDisableUnlink\":\"\"}},\"__FramerMetadata__\":{\"type\":\"variable\"}}}\n//# sourceMappingURL=./ReadingTime.map"],"mappings":"4JAUG,SAAwB,EAAY,EAAM,CAAC,GAAK,CAAC,OAAK,cAAY,WAAS,QAAM,aAAW,EAG2B,IAHO,EAAK,IAAc,CAAC,IAAI,EAEvJ,GAFsK,AACjK,EADoK,IAAc,YAA4B,IAC/L,IACjB,CAAC,EAAK,MAAO,GACjB,IAAM,EAAM,EAAK,KAAK,CAAC,CAAC,MAAM,KAAK,CAAC,CAAC,OAAyD,OAAhC,KAAK,KAAK,EAAM,CAAiC,CAAE,EAAoB,CAAqB,EAAK,CAAW,EAAQ,EAAY,IAAW,UAAU,IAAc,EAAE,SAAS,UAAU,IAAc,EAAE,SAAS,UAAU,OAAoB,EAAM,IAAI,CAAC,MAAM,CAAC,GAAG,EAAM,MAAM,MAAM,EAAM,UAAU,OAAO,CAAC,EAAE,SAAS,CAAC,EAAY,IAAI,CAAW,CAAC,CAAC,CAAE,iBALzW,IAAoD,EAKsT,EAAY,aAAa,CAAC,KAAK,GAAG,YAAY,YAAY,SAAS,SAAS,EAAE,EAAoB,EAAY,CAAC,KAAK,CAAC,KAAK,EAAY,OAAO,MAAM,OAAO,aAAa,GAAG,YAAY,mCAAmC,gBAAgB,GAAK,OAAO,EAAM,CAAC,OAAO,EAAM,kBAAkB,EAAM,CAAC,EAAE,YAAY,CAAC,KAAK,EAAY,KAAK,MAAM,eAAe,QAAQ,CAAC,YAAY,qBAAqB,EAAE,aAAa,YAAY,YAAY,mDAAmD,EAAE,SAAS,CAAC,KAAK,EAAY,KAAK,MAAM,WAAW,QAAQ,CAAC,UAAU,SAAS,EAAE,aAAa,UAAU,wBAAwB,EAAI,EAAE,MAAM,CAAC,KAAK,EAAY,KAAK,MAAM,QAAQ,SAAS,WAAW,qBAAqB,EAAK,EAAE,UAAU,CAAC,MAAM,QAAQ,KAAK,EAAY,MAAM,aAAa,OAAO,YAAY,+DAA+D,CAAC,CAAC"}