{"version":3,"file":"Button_component.DDAuJ5-p.mjs","names":["_Fragment"],"sources":["https:/framerusercontent.com/modules/AMuYs81zAxELaPBTdCo2/PgxBZ3NwVJ8nWMREwInP/Button_component.js"],"sourcesContent":["import{jsx as _jsx,Fragment as _Fragment}from\"react/jsx-runtime\";import*as React from\"react\";import{addPropertyControls,ControlType}from\"framer\";// 🔧 Toggle de debug global: poner en true para activar logs\nconst DEBUG=false;// Helper para loguear solo si DEBUG = true\nfunction debugLog(...args){if(DEBUG)console.log(...args);}/**\n * 🎯 ButtonWithDelay Component\n * - Componente que oculta su contenido al inicio\n * - Tras un delay configurable lo muestra con fade-in\n * - Solo configura el delay, resto como el script original\n */export function ButtonWithDelay(props){const{delay=337e3,dataFramerName,hrefPattern,buttonText,children}=props;React.useEffect(()=>{debugLog(\"🔍 [ButtonWithDelay] Mount\");debugLog(\"⏱ Delay configurado:\",delay,\"ms\");debugLog(\"📱 User Agent:\",navigator.userAgent);// Solo buscar y ocultar si se proporcionan parámetros de búsqueda\nif(!dataFramerName&&!hrefPattern&&!buttonText){debugLog(\"⚠️ No se proporcionaron par\\xe1metros de b\\xfasqueda, no se ocultar\\xe1 ning\\xfan bot\\xf3n\");return;}// Ocultar inmediatamente con CSS para evitar flash visible\nconst hideButtonsImmediately=()=>{if(dataFramerName){const elements=document.querySelectorAll(`a[data-framer-name=\"${dataFramerName}\"]`);elements.forEach(el=>{el.style.opacity=\"0\";el.style.pointerEvents=\"none\";el.style.transition=\"none\";});}if(hrefPattern){const elements=document.querySelectorAll(`a[href*=\"${hrefPattern}\"]`);elements.forEach(el=>{el.style.opacity=\"0\";el.style.pointerEvents=\"none\";el.style.transition=\"none\";});}if(buttonText){const links=document.querySelectorAll(\"a\");links.forEach(link=>{if(link.textContent?.includes(buttonText)){link.style.opacity=\"0\";link.style.pointerEvents=\"none\";link.style.transition=\"none\";}});}};// Agregar CSS inmediato para ocultar botones antes del JS\nconst addImmediateCSS=()=>{if(dataFramerName||hrefPattern||buttonText){const styleId=\"button-delay-hide\";if(!document.getElementById(styleId)){const style=document.createElement(\"style\");style.id=styleId;let css=\"\";if(dataFramerName){css+=`a[data-framer-name=\"${dataFramerName}\"] { opacity: 0 !important; pointer-events: none !important; transition: none !important; }`;}if(hrefPattern){css+=`a[href*=\"${hrefPattern}\"] { opacity: 0 !important; pointer-events: none !important; transition: none !important; }`;}if(buttonText){// Para texto necesitamos un selector más específico\ncss+=`a:not([data-processed]) { opacity: 0 !important; pointer-events: none !important; transition: none !important; }`;}style.textContent=css;document.head.appendChild(style);}}};// Ejecutar CSS inmediatamente\naddImmediateCSS();// Ejecutar JavaScript inmediatamente\nhideButtonsImmediately();// Función para buscar el botón con múltiples intentos\nconst findButton=()=>{let btn=null;// Buscar el botón en el DOM - probar varios selectores\nif(dataFramerName){btn=document.querySelector(`a[data-framer-name=\"${dataFramerName}\"]`);debugLog(\"🔍 B\\xfasqueda por data-framer-name:\",dataFramerName,\"Resultado:\",!!btn);}if(!btn&&hrefPattern){btn=document.querySelector(`a[href*=\"${hrefPattern}\"]`);debugLog(\"🔍 B\\xfasqueda por href pattern:\",hrefPattern,\"Resultado:\",!!btn);}if(!btn&&buttonText){const links=document.querySelectorAll(\"a\");btn=Array.from(links).find(link=>link.textContent?.includes(buttonText))||null;debugLog(\"🔍 B\\xfasqueda por texto:\",buttonText,\"Resultado:\",!!btn);}return btn;};// Función para aplicar estilos de manera compatible con móviles\nconst applyStyles=(element,opacity,pointerEvents,addTransition=false)=>{element.style.opacity=opacity;element.style.pointerEvents=pointerEvents;element.style.webkitOpacity=opacity;// Solo agregar transición cuando se va a mostrar (fade-in)\nif(addTransition){element.style.webkitTransition=\"opacity 0.8s ease-in-out\";element.style.transition=\"opacity 0.8s ease-in-out\";}else{element.style.webkitTransition=\"none\";element.style.transition=\"none\";}// Forzar repaint en móviles\nelement.offsetHeight;};// Función principal con reintentos para móviles\nconst initButton=()=>{const btn=findButton();if(btn){debugLog(\"🔍 Bot\\xf3n encontrado:\",btn);// Ocultar el botón inmediatamente SIN transición\napplyStyles(btn,\"0\",\"none\",false);debugLog(\"🔍 Bot\\xf3n ocultado inicialmente\");// Luego mostrar tras el delay CON transición\nconst showTimeout=setTimeout(()=>{// Remover el CSS de ocultación\nconst styleElement=document.getElementById(\"button-delay-hide\");if(styleElement){styleElement.remove();}// Aplicar estilos con transición\napplyStyles(btn,\"1\",\"auto\",true);debugLog(\"✅ Bot\\xf3n visible tras delay\");},delay);return()=>clearTimeout(showTimeout);}else{debugLog(\"⚠️ No se encontr\\xf3 el bot\\xf3n en el DOM\");// Listar todos los enlaces para debug\nconst allLinks=document.querySelectorAll(\"a\");debugLog(\"🔍 Enlaces encontrados:\",allLinks.length);allLinks.forEach((link,index)=>{debugLog(`Link ${index}:`,link.href,link.textContent?.trim());});}};// Múltiples intentos para móviles (DOM puede tardar más en cargar)\nconst attemptInit=()=>{let attempts=0;const maxAttempts=5;const attemptDelay=200;const tryInit=()=>{attempts++;debugLog(`🔄 Intento ${attempts}/${maxAttempts}`);initButton();// Si no encuentra el botón y no hemos llegado al máximo, reintentar\nif(attempts<maxAttempts){setTimeout(tryInit,attemptDelay);}};tryInit();};// Esperar a que el DOM esté listo con diferentes estrategias\nif(document.readyState===\"loading\"){document.addEventListener(\"DOMContentLoaded\",attemptInit);}else{// DOM ya está listo, pero dar un pequeño delay para móviles\nsetTimeout(attemptInit,100);}// Cleanup function\nreturn()=>{// Limpiar event listeners si es necesario\ndocument.removeEventListener(\"DOMContentLoaded\",attemptInit);};},[delay,dataFramerName,hrefPattern,buttonText]);return /*#__PURE__*/_jsx(_Fragment,{children:children});}// 🎛️ Controles configurables\naddPropertyControls(ButtonWithDelay,{delay:{type:ControlType.Number,title:\"Delay (ms)\",defaultValue:337e3,min:0,step:1e3,displayStepper:true},dataFramerName:{type:ControlType.String,title:\"Data Framer Name\",placeholder:\"Main (opcional)\"},hrefPattern:{type:ControlType.String,title:\"Href Pattern\",placeholder:\"tally.so (opcional)\"},buttonText:{type:ControlType.String,title:\"Button Text\",placeholder:\"SOLICITAR PREINSCRIPCI\\xd3N (opcional)\"}});\nexport const __FramerMetadata__ = {\"exports\":{\"ButtonWithDelay\":{\"type\":\"reactComponent\",\"name\":\"ButtonWithDelay\",\"slots\":[],\"annotations\":{\"framerContractVersion\":\"1\"}},\"__FramerMetadata__\":{\"type\":\"variable\"}}}\n//# sourceMappingURL=./Button_component.map"],"mappings":"oTAOG,SAAgB,EAAgB,EAAM,CAAC,GAAK,CAAC,QAAM,MAAM,iBAAe,cAAY,aAAW,WAAS,CAAC,EAuBI,OAvBE,MAAoB,CACtI,GADoP,EAAU,UAC3P,CAAC,GAAgB,CAAC,GAAa,CAAC,EAAmH,OACtJ,IAAM,MAA2B,CAAC,GAAG,EAAe,CAAC,IAAM,EAAS,SAAS,iBAAiB,uBAAuB,EAAe,KAAK,EAAS,QAAQ,GAAI,CAAC,EAAG,MAAM,QAAQ,IAAI,EAAG,MAAM,cAAc,OAAO,EAAG,MAAM,WAAW,MAAQ,EAAG,IAAG,EAAY,CAAC,IAAM,EAAS,SAAS,iBAAiB,YAAY,EAAY,KAAK,EAAS,QAAQ,GAAI,CAAC,EAAG,MAAM,QAAQ,IAAI,EAAG,MAAM,cAAc,OAAO,EAAG,MAAM,WAAW,MAAQ,EAAG,IAAG,EAAW,CAAC,IAAM,EAAM,SAAS,iBAAiB,KAAK,EAAM,QAAQ,GAAM,CAAI,EAAK,aAAa,SAAS,KAAa,EAAK,MAAM,QAAQ,IAAI,EAAK,MAAM,cAAc,OAAO,EAAK,MAAM,WAAW,OAAS,EAAG,CAAC,EAC7nB,MAAoB,CAAC,GAAG,GAAgB,GAAa,EAAW,CAAC,IAAM,EAAQ,oBAAoB,GAAG,CAAC,SAAS,eAAe,GAAS,CAAC,IAAM,EAAM,SAAS,cAAc,SAAS,EAAM,GAAG,EAAQ,IAAI,EAAI,GAAM,IAAgB,GAAK,uBAAuB,EAAe,8FAAiG,IAAa,GAAK,YAAY,EAAY,8FAAiG,IACjgB,GAA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