{"version":3,"file":"HighlightText.B3sdYOF6.mjs","names":["useRef","useState"],"sources":["https:/framerusercontent.com/modules/Y6Dg7cRgvzoUB5MiyOtr/9vC4881K9H65GgoLZHuN/HighlightText.js"],"sourcesContent":["import{jsx as _jsx,jsxs as _jsxs}from\"react/jsx-runtime\";import{useEffect,useRef,useState}from\"react\";import{addPropertyControls,ControlType}from\"framer\";// Líneas equilibradas (sin viudas) y \"The Body Response\" nunca partido.\nconst TW_BALANCE={textWrap:\"balance\"};const keepTogether=s=>typeof s===\"string\"?s.replace(/The Body Response/g,\"The Body Response\"):s;// Fuentes disponibles por instancia (modo \"En línea\").\nconst FONTS={serifLight:{family:'\"Noto Serif\", Georgia, serif',weight:300},serifMedium:{family:'\"Noto Serif\", Georgia, serif',weight:500},displayMedium:{family:'\"Noto Serif Display\", \"Noto Serif\", Georgia, serif',weight:500}};const FONT_CSS=`@import url(\"https://fonts.googleapis.com/css2?family=Noto+Serif:wght@300;500&family=Noto+Serif+Display:wght@500&display=swap\");`;const SERIF='\"Noto Serif\", Georgia, serif';/**\n * Texto con un tramo destacado tipo marcador amarillo que se dibuja\n * de izquierda a derecha al entrar en pantalla con el scroll.\n *\n * Formato \"T2 + C1\" (por defecto): el destacado va como frase propia en\n * estilo TBR/T2 (Noto Serif 500, 30px) y el resto pasa a un párrafo aparte\n * en estilo TBR/C1 (Noto Serif 300, 20px).\n * Formato \"En línea\": el comportamiento anterior, todo en un solo párrafo.\n *\n * @framerSupportedLayoutWidth any-prefer-fixed\n * @framerSupportedLayoutHeight auto\n */export default function HighlightText(props){const{format,highlight,rest,color,highlightColor,fontSize,t2Size,t2MobileSize,gap,align,duration,delay,replay,thickness,highlightFont,restFont}=props;const ref=useRef(null);const[on,setOn]=useState(false);useEffect(()=>{const el=ref.current;if(!el||typeof IntersectionObserver===\"undefined\"){setOn(true);return;}const io=new IntersectionObserver(([entry])=>{if(entry.isIntersecting){setOn(true);if(!replay)io.disconnect();}else if(replay){setOn(false);}},{threshold:.6});io.observe(el);return()=>io.disconnect();},[replay]);const top=100-thickness;const markStyle={backgroundImage:`linear-gradient(to bottom, transparent ${top}%, ${highlightColor} ${top}%)`,backgroundRepeat:\"no-repeat\",backgroundPosition:\"0 0\",backgroundSize:on?\"100% 100%\":\"0% 100%\",transition:`background-size ${duration}s cubic-bezier(0.65, 0, 0.35, 1) ${delay}s`,boxDecorationBreak:\"clone\",WebkitBoxDecorationBreak:\"clone\",padding:\"0 2px\",margin:\"0 -2px\"};// ── Formato T2 + C1 ─────────────────────────────────────────────\nif(format!==\"inline\"){const t2Max=Math.max(t2Size||30,1);const t2Min=Math.min(Math.max(t2MobileSize||24,1),t2Max);// Escala suave entre 340px y 720px de ancho del contenedor.\nconst slope=(t2Max-t2Min)/(720-340);const base=t2Min-slope*340;const t2FontSize=t2Max>t2Min?`clamp(${t2Min}px, calc(${base.toFixed(2)}px + ${(slope*100).toFixed(3)}cqi), ${t2Max}px)`:`${t2Max}px`;const restText=typeof rest===\"string\"?rest.replace(/^\\s+/,\"\"):rest;return /*#__PURE__*/_jsxs(\"div\",{ref:ref,style:{width:\"100%\",containerType:\"inline-size\",display:\"flex\",flexDirection:\"column\",gap,textAlign:align,color},children:[/*#__PURE__*/_jsx(\"style\",{dangerouslySetInnerHTML:{__html:FONT_CSS}}),/*#__PURE__*/_jsx(\"p\",{style:{margin:0,fontFamily:SERIF,fontWeight:500,fontSize:t2FontSize,lineHeight:1.3,letterSpacing:\"-0.01em\",color,...TW_BALANCE},children:/*#__PURE__*/_jsx(\"span\",{style:markStyle,children:keepTogether(highlight)})}),restText?/*#__PURE__*/_jsx(\"p\",{style:{margin:0,fontFamily:SERIF,fontWeight:300,fontSize,lineHeight:1.55,letterSpacing:0,color,...TW_BALANCE},children:keepTogether(restText)}):null]});}// ── Formato en línea (anterior) ─────────────────────────────────\nconst hf=FONTS[highlightFont]||FONTS.serifLight;const rf=FONTS[restFont]||FONTS.serifLight;const needsFonts=highlightFont&&highlightFont!==\"serifLight\"||restFont&&restFont!==\"serifLight\";return /*#__PURE__*/_jsx(\"div\",{ref:ref,style:{width:\"100%\"},children:/*#__PURE__*/_jsxs(\"p\",{style:{margin:0,width:\"100%\",fontFamily:rf.family,fontWeight:rf.weight,fontSize,lineHeight:1.55,letterSpacing:0,color,textAlign:align,...TW_BALANCE},children:[needsFonts&&/*#__PURE__*/_jsx(\"style\",{dangerouslySetInnerHTML:{__html:FONT_CSS}}),/*#__PURE__*/_jsx(\"span\",{style:{...markStyle,fontFamily:hf.family,fontWeight:hf.weight},children:keepTogether(highlight)}),keepTogether(rest)]})});}HighlightText.defaultProps={format:\"stacked\",highlight:\"No perfect protocol. No one-size-fits-all answer.\",rest:\"A practical way to understand your body and make better decisions from there.\",color:\"rgb(83, 89, 86)\",highlightColor:\"rgb(247, 215, 88)\",fontSize:20,t2Size:30,t2MobileSize:24,gap:16,align:\"center\",duration:.9,delay:.15,replay:false,thickness:55,highlightFont:\"serifLight\",restFont:\"serifLight\"};const FONT_OPTIONS=[\"serifLight\",\"serifMedium\",\"displayMedium\"];const FONT_TITLES=[\"Noto Serif Light\",\"Noto Serif Medium\",\"Noto Serif Display Medium\"];const isInline=p=>p.format===\"inline\";addPropertyControls(HighlightText,{format:{type:ControlType.Enum,title:\"Formato\",options:[\"stacked\",\"inline\"],optionTitles:[\"T2 + C1\",\"En l\\xednea\"],displaySegmentedControl:true,defaultValue:\"stacked\"},highlight:{type:ControlType.String,title:\"Destacado\",displayTextArea:true,defaultValue:\"No perfect protocol. No one-size-fits-all answer.\"},rest:{type:ControlType.String,title:\"Resto\",displayTextArea:true,defaultValue:\"A practical way to understand your body and make better decisions from there.\"},t2Size:{type:ControlType.Number,title:\"Tama\\xf1o T2\",defaultValue:30,min:16,max:64,unit:\"px\",hidden:isInline},t2MobileSize:{type:ControlType.Number,title:\"T2 m\\xf3vil\",defaultValue:24,min:14,max:64,unit:\"px\",hidden:isInline},fontSize:{type:ControlType.Number,title:\"Tama\\xf1o C1\",defaultValue:20,min:12,max:40,unit:\"px\"},gap:{type:ControlType.Number,title:\"Espacio\",defaultValue:16,min:0,max:64,unit:\"px\",hidden:isInline},highlightFont:{type:ControlType.Enum,title:\"Fuente destacado\",options:FONT_OPTIONS,optionTitles:FONT_TITLES,defaultValue:\"serifLight\",hidden:p=>!isInline(p)},restFont:{type:ControlType.Enum,title:\"Fuente resto\",options:FONT_OPTIONS,optionTitles:FONT_TITLES,defaultValue:\"serifLight\",hidden:p=>!isInline(p)},color:{type:ControlType.Color,title:\"Texto\",defaultValue:\"rgb(83, 89, 86)\"},highlightColor:{type:ControlType.Color,title:\"Marcador\",defaultValue:\"rgb(247, 215, 88)\"},align:{type:ControlType.Enum,title:\"Alineaci\\xf3n\",options:[\"left\",\"center\"],optionTitles:[\"Izq\",\"Centro\"],displaySegmentedControl:true,defaultValue:\"center\"},thickness:{type:ControlType.Number,title:\"Grosor %\",defaultValue:55,min:20,max:100,step:5},duration:{type:ControlType.Number,title:\"Duraci\\xf3n\",defaultValue:.9,min:.2,max:3,step:.1,unit:\"s\"},delay:{type:ControlType.Number,title:\"Delay\",defaultValue:.15,min:0,max:2,step:.05,unit:\"s\"},replay:{type:ControlType.Boolean,title:\"Repetir\",defaultValue:false,enabledTitle:\"S\\xed\",disabledTitle:\"No\"}});\nexport const __FramerMetadata__ = {\"exports\":{\"default\":{\"type\":\"reactComponent\",\"name\":\"HighlightText\",\"slots\":[],\"annotations\":{\"framerContractVersion\":\"1\",\"framerSupportedLayoutHeight\":\"auto\",\"framerSupportedLayoutWidth\":\"any-prefer-fixed\"}},\"__FramerMetadata__\":{\"type\":\"variable\"}}}\n//# sourceMappingURL=./HighlightText.map"],"mappings":"+LAaG,SAAwB,EAAc,EAAM,CAAC,GAAK,CAAC,SAAO,YAAU,OAAK,QAAM,iBAAe,WAAS,SAAO,eAAa,MAAI,QAAM,WAAS,QAAM,SAAO,YAAU,gBAAc,YAAU,EAAY,EAAIA,EAAO,IAAI,EAAO,CAAC,EAAG,GAAOC,EAAS,EAAK,E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