{"title":"GenesisSearch","description":"\u003c!-- 🔍 BUSCADOR IA REFACCIONES PRO --\u003e\n\n\u003cmeta name=\"viewport\" content=\"width=device-width, initial-scale=1\"\u003e\n\n\u003cdiv class=\"buscador-wrap\"\u003e\n  \n  \u003ch2 class=\"buscador-title\"\u003e\n  🚀 Buscar numero de parte | \n  \u003cspan id=\"abrir-ayuda\" style=\"color:#1a73e8; cursor:pointer; text-decoration:underline;\"\u003e\n    Ayuda?\n  \u003c\/span\u003e\n\u003c\/h2\u003e\n\n  \u003c!-- Google CSE --\u003e\n  \u003cscript async src=\"https:\/\/cse.google.com\/cse.js?cx=a7a0ac5fbd20542ae\"\u003e\u003c\/script\u003e\n  \u003cdiv class=\"gcse-search\"\u003e\u003c\/div\u003e\n\n\u003c\/div\u003e\n\n\u003c!-- 🔥 MODAL AYUDA --\u003e\n\u003cdiv id=\"modal-ayuda\" class=\"modal-ayuda\"\u003e\n\n  \u003cdiv class=\"modal-contenido\"\u003e\n    \n    \u003cspan id=\"cerrar-ayuda\" class=\"cerrar\"\u003e×\u003c\/span\u003e\n\n    \u003ch3\u003e🔍 Cómo buscar refacciones\u003c\/h3\u003e\n\n    \u003cp\u003e✔ Escribe la refaccion \/ auto \/ año \/ marca\u003c\/p\u003e\n    \u003cp\u003e✔ Ejemplo: \u003cb\u003efiltro aire jetta 2005 interfil\u003c\/b\u003e\u003c\/p\u003e\n    \u003cp\u003e✔ Ejemplo: \u003cb\u003erotula jetta 2005 syd\u003c\/b\u003e\u003c\/p\u003e\n    \u003cp\u003e✔ Doble click sobre el codigo que encontraste\u003c\/p\u003e\n\n    \u003cbr\u003e\n\n    \u003cp style=\"font-size:13px; color:#666;\"\u003e\n      💡 Tip: Usa el cotizador para obtener tu precio más rápido\n    \u003c\/p\u003e\n\n  \u003c\/div\u003e\n\n\u003c\/div\u003e\n\n\u003cstyle\u003e\n\n\/* ===============================\n   🔥 CONTENEDOR\n=============================== *\/\n.buscador-wrap{\n  max-width:900px;\n  margin:auto;\n  padding:20px;\n  background:#fff;\n  border-radius:14px;\n  box-shadow:0 6px 25px rgba(0,0,0,.08);\n}\n\n\/* ===============================\n   🔥 TITULO\n=============================== *\/\n.buscador-title{\n  text-align:center;\n  font-size:18px;\n  margin-bottom:15px;\n  font-weight:600;\n}\n\n\/* ===============================\n   🔥 FORZAR IZQUIERDA (CLAVE)\n=============================== *\/\n.gsc-control-cse{\n  text-align:left !important;\n}\n\n.gsc-search-box{\n  text-align:left !important;\n}\n\n.gsc-search-box-table{\n  margin-left:0 !important;\n  margin-right:auto !important;\n  width:auto !important;\n}\n\n\/* ===============================\n   🔥 INPUT CONTENEDOR\n=============================== *\/\ntd.gsc-input{\n  width:100% !important;\n  text-align:left !important;\n}\n\n.gsc-input-box{\n  width:100% !important;\n  margin-left:0 !important;\n}\n\n\/* ===============================\n   🔥 INPUT\n=============================== *\/\ninput.gsc-input{\n  height:52px !important;\n  padding:12px !important;\n  border-radius:10px !important;\n  border:1px solid #ddd !important;\n  box-shadow:none !important;\n  font-size:16px !important;\n\n  \/* 🔥 CONTROL DE ANCHO *\/\n  width:130% !important;   \/* 👈 AJUSTA AQUÍ *\/\n  max-width:none !important;\n\n  margin-left:0 !important;\n  display:block;\n  box-sizing:border-box !important;\n}\n\n\/* ===============================\n   🔥 BOTON\n=============================== *\/\ntd.gsc-search-button{\n  width:auto !important;\n}\n\ninput.gsc-search-button{\n  background:#1a73e8 !important;\n  color:#fff !important;\n  border:none !important;\n  padding:12px 22px !important;\n  border-radius:10px !important;\n  font-weight:600 !important;\n  margin-left:8px !important;\n}\n\n\/* ===============================\n   🔥 LIMPIAR BORDES GOOGLE\n=============================== *\/\n.gsc-control-cse,\n.gsc-control-cse-es,\n.gsc-search-box,\n.gsc-input-box{\n  border:none !important;\n  background:transparent !important;\n  box-shadow:none !important;\n}\n\n\/* ===============================\n   🔥 RESULTADOS\n=============================== *\/\n.gsc-webResult{\n  border-bottom:1px solid #eee;\n  padding:10px 0;\n}\n\n\/* ===============================\n   🔥 EFECTO HOVER\n=============================== *\/\n.gsc-webResult:hover{\n  background:#f8f9fa;\n  border-radius:8px;\n}\n\n\/* ===============================\n🔥 MODAL FONDO\n=============================== *\/\n.modal-ayuda{\n  display:none;\n  position:fixed;\n  top:0;\n  left:0;\n  width:100%;\n  height:100%;\n  background:rgba(0,0,0,0.6);\n  z-index:9999;\n  justify-content:center;\n  align-items:center;\n}\n\n\/* ===============================\n🔥 CONTENIDO\n=============================== *\/\n.modal-contenido{\n  background:#fff;\n  padding:25px;\n  border-radius:12px;\n  max-width:400px;\n  width:90%;\n  box-shadow:0 10px 30px rgba(0,0,0,.2);\n  animation:fadeIn .3s ease;\n}\n\n\/* ===============================\n🔥 BOTON CERRAR\n=============================== *\/\n.cerrar{\n  position:absolute;\n  right:20px;\n  top:15px;\n  font-size:22px;\n  cursor:pointer;\n}\n\n\/* ===============================\n🔥 ANIMACIÓN\n=============================== *\/\n@keyframes fadeIn{\n  from{opacity:0; transform:scale(.9);}\n  to{opacity:1; transform:scale(1);}\n}\n  \n\n\u003c\/style\u003e\n\n\u003cscript\u003e\n\n\/\/ ===============================\n\/\/ 🔥 CONTROL ANTI BLOQUEO\n\/\/ ===============================\nlet bloqueado = false;\n\n\/\/ ===============================\n\/\/ 🧼 LIMPIAR SKU (CLAVE)\n\/\/ ===============================\nfunction limpiarSKU(sku) {\n  if (!sku) return sku;\n  return sku.toUpperCase().replace(\/[^A-Z0-9]\/g, '').trim();\n}\n\n\/\/ ===============================\nconst palabrasIgnoradas = [\n  'filtro','aceite','refaccion','parte','pieza','producto','precio','marca',\n  'modelo','motor','comprar','nuevo','usado','original','oferta',\n  'ford','chevrolet','nissan','honda','mazda','kia','jeep','dodge',\n  'sensor','jetta','volkswagen','vw','chevy',\n  'mercadolibre','amazon','ebay','genesis1','com','mx','www'\n];\n\n\/\/ ===============================\nconst patronesSKU = [\n  \/sku[:\\s#]*([A-Z0-9-]{4,20})\/i,\n  \/part\\s*(number|no\\.?|#)[:\\s]*([A-Z0-9-]{4,20})\/i,\n  \/oem[:\\s]*([A-Z0-9-]{4,20})\/i,\n  \/(no\\.?\\s*de\\s*parte)[:\\s]*([A-Z0-9-]{4,20})\/i,\n  \/(codigo|código)[:\\s]*([A-Z0-9-]{4,20})\/i\n];\n\n\/\/ ===============================\nlet ultimaBusqueda = \"\";\n\nfunction esNuevaBusqueda() {\n  const input = document.querySelector('input.gsc-input');\n  if (!input) return false;\n\n  const actual = input.value.trim();\n\n  if (actual \u0026\u0026 actual !== ultimaBusqueda) {\n    ultimaBusqueda = actual;\n\n    document.querySelectorAll('.gsc-webResult').forEach(el =\u003e {\n      delete el.dataset.procesado;\n    });\n\n    document.querySelectorAll('a.gs-title').forEach(el =\u003e {\n      delete el.dataset.skuProcesado;\n    });\n\n    return true;\n  }\n\n  return false;\n}\n\n\/\/ ===============================\nfunction eliminarResultadosViejos() {\n  const resultados = document.querySelectorAll('.gsc-webResult');\n  if (resultados.length \u003c= 10) return;\n  for (let i = 10; i \u003c resultados.length; i++) {\n    resultados[i].remove();\n  }\n}\n\n\/\/ ===============================\nfunction obtenerMarcaDesdeBusqueda() {\n  const input = document.querySelector('input.gsc-input');\n  if (!input) return null;\n  const palabras = input.value.trim().toLowerCase().split(\/\\s+\/);\n  return palabras.length ? palabras[palabras.length - 1] : null;\n}\n\n\/\/ ===============================\nfunction puntajePorMarca(texto, marca) {\n  if (!marca) return 0;\n  return texto.toLowerCase().includes(marca) ? 10 : 0;\n}\n\n\/\/ ===============================\nfunction esCodigoValido(c) {\n  if (!c) return false;\n  c = c.toUpperCase().replace(\/[^A-Z0-9]\/g, '');\n  if (\/^\\d{4}$\/.test(c)) return false;\n  if (\/^\\d{4,6}$\/.test(c)) return true;\n  if (\/^(?=.*[A-Z])(?=.*\\d)[A-Z0-9]{4,12}$\/.test(c)) return true;\n  return false;\n}\n\n\/\/ ===============================\nfunction obtenerTodosLosSKUs(texto) {\n\n  let resultados = [];\n\n  patronesSKU.forEach(patron =\u003e {\n    let match;\n    while ((match = patron.exec(texto)) !== null) {\n      const codigo = match[1] || match[2];\n      if (codigo \u0026\u0026 esCodigoValido(codigo)) {\n        resultados.push(codigo.toUpperCase());\n      }\n    }\n  });\n\n  const posibles = texto.match(\/\\b[A-Z0-9.-]{4,20}\\b\/ig) || [];\n\n  posibles.forEach(p =\u003e {\n    const limpio = p.toUpperCase().replace(\/[^A-Z0-9]\/g, '');\n    if (!esCodigoValido(limpio)) return;\n    if (palabrasIgnoradas.includes(limpio.toLowerCase())) return;\n    resultados.push(limpio);\n  });\n\n  resultados = resultados.sort((a, b) =\u003e b.length - a.length);\n\n  return [...new Set(resultados)];\n}\n\n\/\/ ===============================\nfunction forzarLinksGoogle() {\n\n  eliminarResultadosViejos();\n\n  const resultados = document.querySelectorAll('.gsc-webResult');\n  const marca = obtenerMarcaDesdeBusqueda();\n\n  let lista = [];\n\n  resultados.forEach(res =\u003e {\n\n    let link = res.querySelector('a.gs-title');\n    if (!link) return;\n\n    \/\/ 🔥 ELIMINAR LINK COMPLETAMENTE\n    if (!link.dataset.convertido) {\n\n      const span = document.createElement('span');\n      span.innerHTML = link.innerHTML;\n      span.className = link.className;\n\n      link.parentNode.replaceChild(span, link);\n\n      span.dataset.convertido = \"1\";\n\n      link = span; \/\/ 🔥 actualizar referencia\n    }\n\n    const texto = res.innerText || \"\";\n\n    const skus = obtenerTodosLosSKUs(texto);\n\n    let skuPrincipal = null;\n\n    if (skus.length) {\n\n      const exacto4 = skus.find(s =\u003e \/^\\d{4}$\/.test(s) \u0026\u0026 !['1990','2000','2005','2010'].includes(s));\n\n      if (exacto4) {\n        skuPrincipal = exacto4;\n      } else {\n        const mixto = skus.find(s =\u003e \/^[A-Z0-9]{5,10}$\/.test(s));\n        skuPrincipal = mixto || skus[0];\n      }\n\n    }\n\n    let score = 0;\n    if (skuPrincipal) score += 5;\n    score += puntajePorMarca(texto, marca);\n\n    lista.push({ res, link, sku: skuPrincipal, score });\n\n  });\n\n  lista.sort((a, b) =\u003e b.score - a.score);\n\n  const contenedor = document.querySelector('.gsc-resultsbox-visible');\n  if (!contenedor) return;\n\n  lista.forEach(item =\u003e {\n\n    const { res } = item;\n\n    if (!res.dataset.procesado) {\n      res.dataset.procesado = \"1\";\n    }\n\n    contenedor.appendChild(res);\n\n  });\n\n}\n\n\/\/ ===============================\nlet timeout;\n\nconst observer = new MutationObserver(() =\u003e {\n\n  const contenedor = document.querySelector('.gsc-resultsbox-visible');\n  if (!contenedor) return;\n\n  if (bloqueado) return;\n\n  clearTimeout(timeout);\n\n  timeout = setTimeout(() =\u003e {\n\n    bloqueado = true;\n\n    esNuevaBusqueda();\n    forzarLinksGoogle();\n\n    setTimeout(() =\u003e {\n      bloqueado = false;\n    }, 400);\n\n  }, 300);\n\n});\n\nwindow.addEventListener('load', () =\u003e {\n  observer.observe(document.body, { childList: true, subtree: true });\n});\n\n\u003c\/script\u003e\n\n\u003cscript\u003e\n\n\/\/ ===============================\n\/\/ 🧹 LIMPIEZA FINAL DE LINKS (FUERTE)\n\/\/ ===============================\nfunction limpiarLinksTitulos() {\n\n  const links = document.querySelectorAll('.gsc-webResult a.gs-title');\n\n  links.forEach(link =\u003e {\n\n    if (link.dataset.limpio) return;\n\n    const span = document.createElement('span');\n\n    span.innerHTML = link.innerHTML;\n    span.className = link.className;\n\n    link.parentNode.replaceChild(span, link);\n\n    span.dataset.limpio = \"1\";\n  });\n\n}\n\n\/\/ 🔥 EJECUTAR VARIAS VECES (GANARLE A GOOGLE)\nsetInterval(limpiarLinksTitulos, 500);\n\n\u003c\/script\u003e  \n\n\u003cscript\u003e\n\n\/\/ ===============================\n\/\/ 🧠 DOBLE CLICK → ENVIAR AL COTIZADOR\n\/\/ ===============================\ndocument.addEventListener('dblclick', function() {\n\n  let textoSeleccionado = window.getSelection().toString().trim();\n\n  if (!textoSeleccionado) return;\n\n  \/\/ 🔥 limpiar texto (SKU limpio)\n  const limpio = textoSeleccionado\n    .toUpperCase()\n    .replace(\/[^A-Z0-9]\/g, '');\n\n  if (!limpio) return;\n  if (limpio.length \u003c 4) return;\n\n  try {\n    \/\/ 🔥 guardamos como texto para el cotizador\n    localStorage.setItem(\"cotizador_input_directo\", limpio);\n    localStorage.setItem(\"cotizador_update\", Date.now());\n  } catch(e) {\n    console.error(e);\n  }\n\n  \/\/ 🔥 abrir cotizador\n  window.open(\"https:\/\/genesis1.mx\/pages\/cotizador2026\", \"cotizadorWindow\");\n\n});\n\n\u003c\/script\u003e\n\n\n\u003cscript\u003e\n\n\/\/ ===============================\n\/\/ 📱 DETECTAR DISPOSITIVO\n\/\/ ===============================\nfunction esMovil() {\n  return window.innerWidth \u003c= 768 || \/Android|iPhone|iPad|iPod\/i.test(navigator.userAgent);\n}\n\n\/\/ ===============================\n\/\/ 💬 MOSTRAR MENSAJE DINÁMICO\n\/\/ ===============================\nfunction mostrarMensajeAyuda() {\n\n  \/\/ ❌ evitar duplicados\n  if (document.querySelector('#mensaje-ayuda')) return;\n\n  const mensaje = document.createElement('div');\n\n  mensaje.id = \"mensaje-ayuda\";\n\n  \/\/ 🔥 TEXTO SEGÚN DISPOSITIVO\n  mensaje.innerText = esMovil()\n    ? \"📱 Selecciona el código a buscar\"\n    : \"💡 Doble click sobre el código para buscar\";\n\n  Object.assign(mensaje.style, {\n    position: \"fixed\",\n    bottom: \"80px\",\n    left: \"50%\",\n    transform: \"translateX(-50%)\",\n    background: esMovil() ? \"#050e63\" : \"#111\",\n    color: \"#fff\",\n    padding: \"10px 16px\",\n    borderRadius: \"8px\",\n    fontSize: \"14px\",\n    zIndex: \"9999\",\n    boxShadow: \"0 4px 10px rgba(0,0,0,.2)\",\n    opacity: \"0\",\n    transition: \"opacity 0.3s\"\n  });\n\n  document.body.appendChild(mensaje);\n\n  \/\/ animar entrada\n  setTimeout(() =\u003e {\n    mensaje.style.opacity = \"1\";\n  }, 50);\n\n  \/\/ desaparecer\n  setTimeout(() =\u003e {\n    mensaje.style.opacity = \"0\";\n    setTimeout(() =\u003e mensaje.remove(), 300);\n  }, 4000);\n}\n\n\/\/ ===============================\n\/\/ 🔥 OBSERVER INTELIGENTE\n\/\/ ===============================\nlet observerMensaje;\n\nwindow.addEventListener('load', () =\u003e {\n\n  observerMensaje = new MutationObserver(() =\u003e {\n\n    const resultados = document.querySelector('.gsc-webResult');\n\n    if (resultados) {\n      mostrarMensajeAyuda();\n\n      \/\/ 🔥 solo una vez (opcional pero recomendado)\n      observerMensaje.disconnect();\n    }\n\n  });\n\n  observerMensaje.observe(document.body, {\n    childList: true,\n    subtree: true\n  });\n\n});\n\n\u003c\/script\u003e\n  \n\n\u003cscript\u003e\n\n\/\/ ===============================\n\/\/ 🔧 QUITAR SOLO GUIONES (RESPETANDO ESPACIOS)\n\/\/ ===============================\nfunction limpiarGuionesSolo() {\n\n  const titulos = document.querySelectorAll('.gsc-webResult .gs-title');\n\n  titulos.forEach(el =\u003e {\n\n    if (el.dataset.limpioGuion) return;\n\n    let texto = el.innerHTML;\n\n    \/\/ 🔥 quitar solo el guion, NO el espacio\n    texto = texto.replace(\/-\/g, '');\n\n    \/\/ 🔥 limpiar dobles espacios si quedan\n    texto = texto.replace(\/\\s{2,}\/g, ' ');\n\n    el.innerHTML = texto.trim();\n\n    el.dataset.limpioGuion = \"1\";\n  });\n\n}\n\n\/\/ 🔥 ejecutar varias veces (por Google)\nsetInterval(limpiarGuionesSolo, 500);\n\n\u003c\/script\u003e\n\n\u003cscript\u003e\n\n\/\/ ===============================\n\/\/ 📱 FIX FINAL PRO (SELECCIÓN EXACTA)\n\/\/ ===============================\nlet ultimoTexto = \"\";\nlet timerSeleccion = null;\n\nfunction esMovil() {\n  return window.innerWidth \u003c= 768 || \/Android|iPhone|iPad|iPod\/i.test(navigator.userAgent);\n}\n\ndocument.addEventListener(\"selectionchange\", () =\u003e {\n\n  \/\/ 🔥 opcional: solo en móvil\n  if (!esMovil()) return;\n\n  clearTimeout(timerSeleccion);\n\n  timerSeleccion = setTimeout(() =\u003e {\n\n    const selection = window.getSelection();\n    if (!selection || selection.rangeCount === 0) return;\n\n    let texto = selection.toString().trim();\n\n    if (!texto || texto === ultimoTexto) return;\n\n    ultimoTexto = texto;\n\n    \/\/ ===============================\n    \/\/ 🔥 EXTRAER SKU INTELIGENTE\n    \/\/ ===============================\n    let match = texto.match(\/[A-Z0-9]{3,}\/i);\n\n    if (!match) return;\n\n    let limpio = match[0].toUpperCase();\n\n    \/\/ 🔥 SOLO quitar prefijos largos tipo \"NATIONAL\"\n    if (\/^[A-Z]{4,}\\d+\/.test(limpio)) {\n      limpio = limpio.replace(\/^[A-Z]+(?=\\d)\/, '');\n    }\n\n    \/\/ 🔥 validar mínimo 3 caracteres\n    if (limpio.length \u003c 3) return;\n\n    console.log(\"📱 SKU LIMPIO:\", limpio);\n\n    try {\n      localStorage.setItem(\"cotizador_input_directo\", limpio);\n      localStorage.setItem(\"cotizador_update\", Date.now());\n    } catch(e) {}\n\n    \/\/ 🔥 quitar selección visual\n    selection.removeAllRanges();\n\n    \/\/ 🔥 FIX scroll móvil (clave)\n    window.scrollBy(0, 1);\n    window.scrollBy(0, -1);\n\n    \/\/ 🔥 abrir cotizador\n    setTimeout(() =\u003e {\n      window.open(\"https:\/\/genesis1.mx\/pages\/cotizador2026\", \"_self\");\n    }, 120);\n\n  }, 350);\n\n});\n\n\u003c\/script\u003e\n\n\u003cscript\u003e\n\ndocument.addEventListener(\"DOMContentLoaded\", function () {\n\n  \/\/ 🔥 solo en Duk Duk\n  if (!window.location.href.includes(\"\/collections\/dukduk\")) return;\n\n  \/\/ 🔥 pequeño delay por carga\n  setTimeout(() =\u003e {\n\n    window.scrollBy({\n      top: 250, \/\/ 👈 ajusta aquí (más o menos scroll)\n      behavior: \"smooth\"\n    });\n\n  }, 800);\n\n});\n\n\u003c\/script\u003e  \n\n\u003cscript\u003e\n\n\/\/ abrir modal\ndocument.getElementById(\"abrir-ayuda\").addEventListener(\"click\", function(){\n  document.getElementById(\"modal-ayuda\").style.display = \"flex\";\n});\n\n\/\/ cerrar modal\ndocument.getElementById(\"cerrar-ayuda\").addEventListener(\"click\", function(){\n  document.getElementById(\"modal-ayuda\").style.display = \"none\";\n});\n\n\/\/ cerrar al hacer click fuera\nwindow.addEventListener(\"click\", function(e){\n  const modal = document.getElementById(\"modal-ayuda\");\n  if(e.target === modal){\n    modal.style.display = \"none\";\n  }\n});\n\n\u003c\/script\u003e\n\n\u003cscript\u003e\n\n\/\/ ======================================\n\/\/ 😈 OEM VISIBLE LIGHT PRO ULTRA FINAL\n\/\/ ======================================\n\nlet OEMTrabajando = false;\n\n\/\/ ======================================\n\/\/ 🔥 OEMS \/ BASURA IGNORADA\n\/\/ ======================================\nconst OEMIgnorar = [\n\n  'VOLKSWAGEN',\n  'NISSAN',\n  'CHEVROLET',\n  'FORD',\n  'HONDA',\n  'MAZDA',\n  'TOYOTA',\n  'KIA',\n  'HYUNDAI',\n  'JEEP',\n  'DODGE',\n  'SYD',\n\n  'GOOGLE',\n  'MERCADOLIBRE',\n  'AMAZON',\n  'EBAY',\n\n  'REFACCION',\n  'REFACCIONES',\n  'PRODUCTO',\n  'NATIONAL',\n  'LITRO',\n  'LITROS',\n\n  'JETTA2005',\n  'POLO2005',\n  'DERBY2005'\n\n];\n\n\/\/ ======================================\n\/\/ 🔥 LIMPIAR OEM\n\/\/ ======================================\nfunction limpiarOEM(oem){\n\n  if(!oem) return \"\";\n\n  let limpio =\n    oem.toUpperCase();\n\n  limpio =\n    limpio.replace(\/[^A-Z0-9-]\/g,'');\n\n  limpio =\n    limpio.replace(\/^-\/,'');\n\n  limpio =\n    limpio.replace(\n      \/^(SYD|NATIONAL|VW|OEM)(?=[A-Z0-9-])\/,\n      ''\n    );\n\n  return limpio;\n\n}\n\n\/\/ ======================================\n\/\/ 🔥 VALIDAR OEM REAL\n\/\/ ======================================\nfunction esOEMValido(oem){\n\n  if(!oem) return false;\n\n  if(oem.length \u003c 5)\n    return false;\n\n  if(\n    OEMIgnorar.includes(oem)\n  ) return false;\n\n  if(\n    \/^19\\d\\d$\/.test(oem) ||\n    \/^20\\d\\d$\/.test(oem)\n  ){\n    return false;\n  }\n\n  if(\n    \/^[A-Z]+$\/.test(oem)\n  ) return false;\n\n  if(\n    \/^\\d+LITRO\/.test(oem)\n  ){\n    return false;\n  }\n\n  if(\n    !\/\\d\/.test(oem)\n  ) return false;\n\n  if(\n    !(\/[A-Z]\/.test(oem) || oem.includes('-'))\n  ){\n    if(!\/^\\d{5,10}$\/.test(oem)){\n      return false;\n    }\n  }\n\n  if(\n    oem.length \u003e 18\n  ) return false;\n\n  if(\n    \/^[A-Z]{12,}\\d+$\/.test(oem)\n  ){\n    return false;\n  }\n\n  return true;\n\n}\n\n\/\/ ======================================\n\/\/ 🔥 DETECTAR OEM VISIBLES\n\/\/ ======================================\nasync function detectarOEMVisible(){\n\n  if(OEMTrabajando) return;\n\n  OEMTrabajando = true;\n\n  const resultados =\n    document.querySelectorAll('.gsc-webResult');\n\n  for(const res of resultados){\n\n    if(res.dataset.oemVisible)\n      continue;\n\n    res.dataset.oemVisible = \"1\";\n\n    const texto =\n      (res.innerText || \"\")\n      .toUpperCase();\n\n    const matches =\n      texto.match(\n        \/\\b[A-Z0-9-]{5,25}\\b\/g\n      ) || [];\n\n    if(!matches.length)\n      continue;\n\n    let candidatos = [];\n\n    matches.forEach(item =\u003e {\n\n      const limpio =\n        limpiarOEM(item);\n\n      if(\n        !esOEMValido(limpio)\n      ) return;\n\n      candidatos.push(limpio);\n\n    });\n\n    if(!candidatos.length)\n      continue;\n\n    candidatos =\n      [...new Set(candidatos)];\n\n    candidatos.sort((a,b) =\u003e {\n\n      const aGuion =\n        a.includes('-');\n\n      const bGuion =\n        b.includes('-');\n\n      if(aGuion \u0026\u0026 !bGuion)\n        return -1;\n\n      if(!aGuion \u0026\u0026 bGuion)\n        return 1;\n\n      const aMixto =\n        \/[A-Z]\/.test(a) \u0026\u0026\n        \/\\d\/.test(a);\n\n      const bMixto =\n        \/[A-Z]\/.test(b) \u0026\u0026\n        \/\\d\/.test(b);\n\n      if(aMixto \u0026\u0026 !bMixto)\n        return -1;\n\n      if(!aMixto \u0026\u0026 bMixto)\n        return 1;\n\n      const aScore =\n        Math.abs(a.length - 10);\n\n      const bScore =\n        Math.abs(b.length - 10);\n\n      return aScore - bScore;\n\n    });\n\n    const oem =\n      candidatos[0];\n\n    console.log(\n      \"😈 OEM FINAL:\",\n      oem\n    );\n\n    if(\n      res.querySelector('.oem-box')\n    ) continue;\n\n    const caja =\n      document.createElement(\"div\");\n\n    caja.className =\n      \"oem-box\";\n\n    caja.innerHTML = `\n      😈 OEM Detectado:\n      \u003cb style=\"\n        color:#0b8043;\n        font-size:20px;\n      \"\u003e\n        ${oem}\n      \u003c\/b\u003e\n    `;\n\n    caja.style.background =\n      \"#e6f4ea\";\n\n    caja.style.padding =\n      \"10px\";\n\n    caja.style.marginTop =\n      \"10px\";\n\n    caja.style.borderRadius =\n      \"8px\";\n\n    caja.style.fontWeight =\n      \"bold\";\n\n    caja.style.cursor =\n      \"pointer\";\n\n    caja.style.fontSize =\n      \"16px\";\n\n    caja.style.border =\n      \"1px solid #c8e6c9\";\n\n    caja.style.transition =\n      \"all .2s ease\";\n\n    caja.addEventListener(\n      \"mouseenter\",\n      () =\u003e {\n\n        caja.style.transform =\n          \"scale(1.01)\";\n\n      }\n    );\n\n    caja.addEventListener(\n      \"mouseleave\",\n      () =\u003e {\n\n        caja.style.transform =\n          \"scale(1)\";\n\n      }\n    );\n\n    \/\/ ======================================\n    \/\/ 🔥 INSERTAR\n    \/\/ ======================================\n    res.appendChild(caja);\n\n  }\n\n  OEMTrabajando = false;\n\n}\n\n\/\/ ======================================\n\/\/ 🚀 OBSERVER LIGERO\n\/\/ ======================================\nconst observerOEMLight =\nnew MutationObserver(() =\u003e {\n\n  clearTimeout(\n    window.timerOEMLight\n  );\n\n  window.timerOEMLight =\n    setTimeout(() =\u003e {\n\n      detectarOEMVisible();\n\n    }, 1200);\n\n});\n\n\/\/ ======================================\n\/\/ 🚀 INICIAR\n\/\/ ======================================\nwindow.addEventListener(\n  \"load\",\n  () =\u003e {\n\n    observerOEMLight.observe(\n      document.body,\n      {\n        childList:true,\n        subtree:true\n      }\n    );\n\n    setTimeout(() =\u003e {\n\n      detectarOEMVisible();\n\n    }, 2500);\n\n  }\n);\n\n\u003c\/script\u003e\n\n","products":[],"url":"https:\/\/genesis1.mx\/collections\/genesissearch.oembed","provider":"Genesis","version":"1.0","type":"link"}