{"version":3,"file":"TrackingOverrides.CS3JcFkQ.mjs","names":["forwardRef","useEffect","_jsx","__esmMin","ce","init_ssg_sandbox_shims","window","c","init_jsx_runtime","init_npm_react_18_3_1","J","FORM_SUBMIT_PAGES","LANDING_PAGE_VIEWS","getCurrentPath","isMatchingPage","isDataLayerAvailable","isGtagAvailable","trackEvent","TrackFormSubmit","TrackLandingPageView","init_TrackingOverrides","paths","currentPath","path","eventName","eventData","error","Component","props","ref","productName"],"sources":["https:/framerusercontent.com/modules/H5VQREEvyUlQrmF7Ifmr/k1cwi4H0ryBbSIyUHOee/TrackingOverrides.js"],"sourcesContent":["import{jsx as _jsx}from\"react/jsx-runtime\";import{forwardRef,useEffect}from\"react\";/**\n * Tracking Overrides para Framer - Versión de Producción\n *\n * Estos overrides pueden aplicarse a cualquier elemento existente en la página.\n *\n * Uso en Framer:\n * 1. Selecciona cualquier componente en la página\n * 2. En el panel derecho → \"Code Override\"\n * 3. Selecciona este archivo y el override correspondiente\n */// ============================================================================\n// ANALYTICS CONFIGURATION\n// ============================================================================\nconst FORM_START_PAGES=[\"/page/solicita-ahora\",\"/page/comienza-pagos-instantaneos\",\"/page/comienza-pagos-autom\\xe1ticos\",\"/page/comienza-waas\",\"/page/contacto-comercial\",\"/en-us/page/solicita-ahora\",\"/en-us/page/contacto-comercial\",\"/en-us/page/comienza-pagos-automaticos\",\"/en-us/page/comienza-pagos-instantaneos\",\"/en-us/page/comienza-waas\"];const FORM_SUBMIT_PAGES=[\"/page/solicitud-recibida\",\"/en-us/page/solicitud-recibida\"];const LANDING_PAGE_VIEWS=[\"/page/product/pagos-instantaneos\",\"/page/product/pagos-automaticos\",\"/page/product/openfinance-waas\"];// ============================================================================\n// HELPER FUNCTIONS\n// ============================================================================\nconst getCurrentPath=()=>{if(typeof window===\"undefined\")return\"\";return window.location.pathname;};const isMatchingPage=paths=>{const currentPath=getCurrentPath();return paths.some(path=>currentPath.includes(path));};const isDataLayerAvailable=()=>{return typeof window!==\"undefined\"&&Array.isArray(window.dataLayer);};const isGtagAvailable=()=>{return typeof window!==\"undefined\"&&typeof window.gtag===\"function\";};const trackEvent=(eventName,eventData)=>{if(isDataLayerAvailable()){try{window.dataLayer.push({event:eventName,...eventData});console.log(`[Analytics] Event: ${eventName}`);}catch(error){console.error(\"[Analytics] Error:\",error);}}else if(isGtagAvailable()){try{window.gtag(\"event\",eventName,eventData);console.log(`[Analytics] Event: ${eventName}`);}catch(error){console.error(\"[Analytics] Error:\",error);}}else{console.warn(`[Analytics] No tracking available for: ${eventName}`);}};// ============================================================================\n// TRACKING OVERRIDES - PRODUCCIÓN\n// ============================================================================\n/**\n * Override: Track Form Submit on Confirmation Pages\n *\n * Aplica este override a cualquier elemento en las páginas de confirmación:\n * - /page/solicitud-recibida\n * - /en-us/page/solicitud-recibida\n */export const TrackFormSubmit=Component=>{return /*#__PURE__*/forwardRef((props,ref)=>{useEffect(()=>{const currentPath=getCurrentPath();if(!isMatchingPage(FORM_SUBMIT_PAGES)){return;}trackEvent(\"form_submit_inbound\",{page_path:currentPath,form_type:\"inbound\",timestamp:new Date().toISOString()});},[]);return /*#__PURE__*/_jsx(Component,{ref:ref,...props});});};/**\n * Override: Track Landing Page View\n *\n * Aplica este override a cualquier elemento en las páginas de productos:\n * - /page/product/pagos-instantaneos\n * - /page/product/pagos-automaticos\n * - /page/product/openfinance-waas\n */export const TrackLandingPageView=Component=>{return /*#__PURE__*/forwardRef((props,ref)=>{useEffect(()=>{const currentPath=getCurrentPath();if(!isMatchingPage(LANDING_PAGE_VIEWS)){return;}// Extract product name from path\nlet productName=\"\";if(currentPath.includes(\"pagos-instantaneos\")){productName=\"Pagos Instant\\xe1neos\";}else if(currentPath.includes(\"pagos-automaticos\")){productName=\"Pagos Autom\\xe1ticos\";}else if(currentPath.includes(\"openfinance-waas\")){productName=\"OpenFinance WaaS\";}trackEvent(\"Page_view_Landing_Page\",{page_path:currentPath,page_type:\"product_landing\",product_name:productName,timestamp:new Date().toISOString()});},[]);return /*#__PURE__*/_jsx(Component,{ref:ref,...props});});};\nexport const __FramerMetadata__ = {\"exports\":{\"TrackLandingPageView\":{\"type\":\"reactHoc\",\"name\":\"TrackLandingPageView\",\"annotations\":{\"framerContractVersion\":\"1\"}},\"TrackFormSubmit\":{\"type\":\"reactHoc\",\"name\":\"TrackFormSubmit\",\"annotations\":{\"framerContractVersion\":\"1\"}},\"__FramerMetadata__\":{\"type\":\"variable\"}}}\n//# sourceMappingURL=./TrackingOverrides.map"],"mappings":"A,uMAY8VW,EAAkB,CAAC,2BAA2B,gCAAgC,EAAQC,EAAmB,CAAC,mCAAmC,kCAAkC,gCAAgC,EAGviBC,MAA8BP,IAAS,OAAkB,GAAUA,EAAO,SAAS,SAAiBQ,EAAeO,GAAO,CAAC,IAAMC,EAAYT,EAAe,EAAE,OAAOQ,EAAM,KAAKE,GAAMD,EAAY,SAASC,CAAI,CAAC,CAAE,EAAQR,MAAwCT,IAAS,QAAa,MAAM,QAAQA,EAAO,SAAS,EAAUU,MAAmCV,IAAS,QAAa,OAAOA,EAAO,MAAO,WAAmBW,GAAYO,EAAUC,IAAY,CAAC,GAAGV,EAAqB,EAAG,GAAG,CAACT,EAAO,UAAU,KAAK,CAAC,MAAMkB,EAAU,GAAGC,CAAS,CAAC,EAAE,QAAQ,IAAI,sBAAsBD,GAAW,CAAE,OAAOE,EAAM,CAAC,QAAQ,MAAM,qBAAqBA,CAAK,CAAE,MAAO,GAAGV,EAAgB,EAAG,GAAG,CAACV,EAAO,KAAK,QAAQkB,EAAUC,CAAS,EAAE,QAAQ,IAAI,sBAAsBD,GAAW,CAAE,OAAOE,EAAM,CAAC,QAAQ,MAAM,qBAAqBA,CAAK,CAAE,MAAO,QAAQ,KAAK,0CAA0CF,GAAW,CAAG,EASn3BN,EAAgBS,GAAgC3B,iBAAY4B,EAAMC,KAAO5B,MAAc,CAAC,IAAMqB,EAAYT,EAAe,EAAMC,EAAeH,CAAiB,GAAWM,EAAW,sBAAsB,CAAC,UAAUK,EAAY,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