var breeze_prefetch = {"local_url":"https://rayarivera.com","ignore_remote_prefetch":"1","ignore_list":["wp-admin","wp-login.php"]};
//# sourceURL=breeze-prefetch-js-extra
https://rayarivera.com/wp-content/plugins/breeze/assets/js/js-front-end/breeze-prefetch-links.min.js
var rrFormNonce = "69ec0ef103";
//# sourceURL=jquery-js-before
https://rayarivera.com/wp-content/plugins/mlsimport/public/js/mlsimport-public.js
document.documentElement.className += " spai_has_js";
(function(w, d){
var b = d.getElementsByTagName('head')[0];
var s = d.createElement("script");
var v = ("IntersectionObserver" in w) ? "" : "-compat";
s.async = true; // This includes the script as async.
s.src = "https://cdn.shortpixel.ai/assets/js/bundles/spai-lib-bg" + v
+ ".1.1.min.js?v=3.11.2";
w.spaiDomain = "cdn.shortpixel.ai";
w.spaiData = {
version: "3.11.2",
key: "spai",
customKeys: [],
quality: "lossy",
convert: "webp",
lqip: false,
rootMargin: "500px",
crop: false,
sizeBreakpoints: {"on":null,"base":null,"rate":null},
backgroundsMaxWidth: 1920,
resizeStyleBackgrounds: true,
nativeLazyLoad: false,
safeLazyBackgrounds: true,
asyncInitialParsing: true,
debug: false,
doSelectors: [{"selectors":"img","type":"attr","targetAttr":"src","attrType":"url","lazy":true,"resize":true},{"selectors":"[data-spai-bg-on]","type":"attr","targetAttr":"style","attrType":"style"},{"selectors":"style","type":"inner","attrType":"style"},{"type":"__stylesheet"}],
exclusions: {"selectors":[],"urls":{"regex:\/\\\/\\\/([^\\\/]*\\.|)gravatar.com\\\/\/":{"lazy":0,"cdn":0,"resize":0,"lqip":0,"crop":-1}}},
sizeFromImageSuffix: true,
ajax_url: "https://rayarivera.com/wp-admin/admin-ajax.php"
};
b.appendChild(s);
}(window, document));
Skip to content
Lexington, KY Real Estate
Find Your Home In The Bluegrass
Your local guide to buying, selling, and finding where you belong in Lexington.
★★★★★ 26 Five-Star Google Reviews
Top 150 Agent
Lexington, KY
The Brokerage KY
Buying A Home
First-time buyer or seasoned investor, I will guide you to the right home in Lexington.
Learn More →
Selling Your Home
Expert pricing, beautiful marketing, and a stress-free experience from listing to closing.
Learn More →
Explore Neighborhoods
Lexington has a neighborhood for everyone. Find the one that fits your lifestyle.
Learn More →
New On The Market
Featured Listings
Explore Lexington
Popular Neighborhoods
About Raya
Your Lexington Real Estate Guide
I am not from Lexington — I chose it. Moved here, started my family here, and fell in love with everything from the horse farms to the local food scene to the neighborhoods that each have their own feel. I got into real estate because I genuinely love helping people find their place in this city. I will tell you what I really think, walk you through the numbers, and make sure you never feel in the dark. That is just how I do things.
Learn More About Me →
From The Blog
Lexington Real Estate Insights
March 29, 2026
Happy new year, friends! January’s market data is in, and I want to walk you through what’s happening across the…
March 29, 2026
Things to Do in Lexington, KY: The Ultimate Guide for New Residents (2026) Moving to Lexington, Kentucky is more than…
March 29, 2026
The Lexington Luxury Real Estate Market in 2025 Lexington’s luxury market is unlike anywhere else in the country. Where else…
WHAT CLIENTS SAY
REAL REVIEWS FROM REAL CLIENTS
★ ★ ★ ★ ★
“Raya was wonderful to work with! As first time home buyers, she walked us through the process with ease. She is very knowledgeable and always available.”
Kayla M.
Google Review
★ ★ ★ ★ ★
“Raya works tirelessly for her clients. She is pleasant, knowledgeable, and made our house hunting experience completely painless.”
Micah H.
Google Review
★ ★ ★ ★ ★
“Raya helped us sell our farmhouse and find our dream home. She is an absolute rockstar and a gem of a person. Cannot recommend her enough!”
K.V.
Google Review
★ ★ ★ ★ ★
“Raya gave us great advice on getting our home ready to sell. Professional photos, stress-free showings, and sold above asking price in days!”
Abigail N.
Google Review
★ ★ ★ ★ ★
“Top-in-class agent with an electric personality. Raya made the entire process smooth and enjoyable. She truly goes above and beyond.”
Kelly H.
Google Review
★ ★ ★ ★ ★
“So grateful for Raya’s hard work and dedication. She helped us navigate a tough market and found exactly what we were looking for. Highly recommend!”
Google Reviewer
Google Review
★ ★ ★ ★ ★
“Raya’s work ethic and commitment to her clients is unmatched. She made our first home purchase a wonderful experience from start to finish.”
Google Reviewer
Google Review
★ ★ ★ ★ ★
“Raya was wonderful to work with! As first time home buyers, she walked us through the process with ease. She is very knowledgeable and always available.”
Kayla M.
Google Review
★ ★ ★ ★ ★
“Raya works tirelessly for her clients. She is pleasant, knowledgeable, and made our house hunting experience completely painless.”
Micah H.
Google Review
★ ★ ★ ★ ★
“Raya helped us sell our farmhouse and find our dream home. She is an absolute rockstar and a gem of a person. Cannot recommend her enough!”
K.V.
Google Review
★ ★ ★ ★ ★
“Raya gave us great advice on getting our home ready to sell. Professional photos, stress-free showings, and sold above asking price in days!”
Abigail N.
Google Review
★ ★ ★ ★ ★
“Top-in-class agent with an electric personality. Raya made the entire process smooth and enjoyable. She truly goes above and beyond.”
Kelly H.
Google Review
★ ★ ★ ★ ★
“So grateful for Raya’s hard work and dedication. She helped us navigate a tough market and found exactly what we were looking for. Highly recommend!”
Google Reviewer
Google Review
★ ★ ★ ★ ★
“Raya’s work ethic and commitment to her clients is unmatched. She made our first home purchase a wonderful experience from start to finish.”
Google Reviewer
Google Review
Verified reviews from Google Business Profile
Let’s Talk
Whether you are ready to make a move or just starting to think about it — I would love to hear from you. No pressure, no sales pitch. Just a real conversation about what you are looking for and how I can help.
Raya Rivera
Real Estate Advisor • The Brokerage KY
(function(){
var map = {"hamburg":"https:\/\/cdn.photos.sparkplatform.com\/imagine\/20260317022212507852000000-o.jpg","chevy-chase":"https:\/\/cdn.photos.sparkplatform.com\/lex\/20250211185914703087000000-o.jpg","beaumont":"https:\/\/cdn.photos.sparkplatform.com\/imagine\/20251020183139346048000000-o.jpg","andover":"https:\/\/cdn.photos.sparkplatform.com\/imagine\/20251114154814113199000000-o.jpg","firebrook":"https:\/\/cdn.photos.sparkplatform.com\/lex\/20250814131215109427000000-o.jpg","garden-springs":"https:\/\/cdn.photos.sparkplatform.com\/imagine\/20251127002447371174000000-o.jpg","hartland":"https:\/\/cdn.photos.sparkplatform.com\/imagine\/20260108220100537118000000-o.jpg","idle-hour":"https:\/\/cdn.photos.sparkplatform.com\/imagine\/20260318002145636185000000-o.jpg","kenwick":"https:\/\/cdn.photos.sparkplatform.com\/imagine\/20260227173952237743000000-o.jpg","masterson-station":"https:\/\/cdn.photos.sparkplatform.com\/imagine\/20260319175829899505000000-o.jpg","meadowthorpe":"https:\/\/cdn.photos.sparkplatform.com\/imagine\/20260301181541704289000000-o.jpg","palomar":"https:\/\/cdn.photos.sparkplatform.com\/imagine\/20251115202324737707000000-o.jpg","southland":"https:\/\/cdn.photos.sparkplatform.com\/imagine\/20260118042504576002000000-o.jpg","winburn":"https:\/\/cdn.photos.sparkplatform.com\/lex\/20250805132551293925000000-o.jpg","zandale":"https:\/\/cdn.photos.sparkplatform.com\/imagine\/20260202205440485748000000-o.jpg","tuscany":"https:\/\/cdn.photos.sparkplatform.com\/lex\/20250510010306333990000000-o.jpg"};
// Build a name-to-slug lookup for homepage cards (which use h3 text, not href slugs)
var nameToSlug = {
'Hamburg': 'hamburg', 'Hamburg Area': 'hamburg',
'Chevy Chase': 'chevy-chase',
'Beaumont': 'beaumont',
'Andover': 'andover',
'Firebrook': 'firebrook',
'Garden Springs': 'garden-springs',
'Hartland': 'hartland',
'Idle Hour': 'idle-hour',
'Kenwick': 'kenwick',
'Masterson Station': 'masterson-station',
'Meadowthorpe': 'meadowthorpe',
'Palomar': 'palomar',
'Southland': 'southland',
'Winburn': 'winburn',
'Zandale': 'zandale',
'Tuscany': 'tuscany'
};
function injectImage(card, url) {
var img = card.querySelector('img');
if (img) {
img.src = url;
img.srcset = '';
img.removeAttribute('data-src');
img.style.opacity = '1';
img.style.width = '100%';
img.style.height = '100%';
img.style.objectFit = 'cover';
img.style.position = 'absolute';
img.style.inset = '0';
return;
}
var newImg = document.createElement('img');
newImg.src = url;
newImg.style.cssText = 'position:absolute;inset:0;width:100%;height:100%;object-fit:cover;';
newImg.alt = '';
card.style.position = 'relative';
card.style.overflow = 'hidden';
card.insertBefore(newImg, card.firstChild);
}
// 1) Neighborhoods page: .nhub-card and .nhub-grid > a (match by href slug)
document.querySelectorAll('.nhub-card, .nhub-grid > a').forEach(function(card){
if (card.offsetWidth <= 0) return;
var href = card.getAttribute('href') || '';
var slug = href.replace(/\/$/, '').split('/').pop();
if (map[slug]) injectImage(card, map[slug]);
});
// 2) Homepage: .nb-card (match by h3 text content)
document.querySelectorAll('.nb-card').forEach(function(card){
if (card.offsetWidth <= 0) return;
var h3 = card.querySelector('h3');
if (!h3) return;
var name = h3.textContent.trim();
var slug = nameToSlug[name];
if (slug && map[slug]) injectImage(card, map[slug]);
});
})();
(function(){
var h = document.querySelector('.site-header');
if (!h) return;
window.addEventListener('scroll', function(){
if (window.scrollY > 100) {
h.classList.add('scrolled');
} else {
h.classList.remove('scrolled');
}
});
})();
// Mobile hamburger menu
(function(){
var header = document.querySelector('.site-header .inside-header');
if (!header) return;
var ham = document.createElement('button');
ham.className = 'rr-hamburger';
ham.setAttribute('aria-label', 'Menu');
ham.setAttribute('aria-expanded', 'false');
ham.innerHTML = '<span></span><span></span><span></span>';
header.appendChild(ham);
var overlay = document.createElement('div');
overlay.className = 'rr-mobile-overlay';
var navLinks = document.querySelectorAll('.main-navigation .main-nav > ul > li > a');
navLinks.forEach(function(a) {
var link = document.createElement('a');
link.href = a.href;
link.textContent = a.textContent;
overlay.appendChild(link);
});
var closeBtn = document.createElement('button');
closeBtn.className = 'rr-nav-close';
closeBtn.textContent = 'CLOSE';
closeBtn.setAttribute('aria-label', 'Close menu');
overlay.insertBefore(closeBtn, overlay.firstChild);
document.body.appendChild(overlay);
function toggleMenu() {
var isOpen = overlay.classList.toggle('open');
ham.classList.toggle('active');
ham.setAttribute('aria-expanded', isOpen);
document.body.style.overflow = isOpen ? 'hidden' : '';
}
ham.addEventListener('click', toggleMenu);
closeBtn.addEventListener('click', toggleMenu);
overlay.querySelectorAll('a').forEach(function(a) {
a.addEventListener('click', function() {
if (overlay.classList.contains('open')) toggleMenu();
});
});
document.addEventListener('keydown', function(e) {
if (e.key === 'Escape' && overlay.classList.contains('open')) toggleMenu();
});
})();
(function(){var c=document.getElementById('sticky-cta'),s=false;window.addEventListener('scroll',function(){if(window.scrollY>400&&!s){c.style.transform='translateY(0)';s=true;}else if(window.scrollY<=400&&s){c.style.transform='translateY(100%)';s=false;}});})();
!function(){"use strict";if("querySelector"in document&&"addEventListener"in window){var e=document.body;e.addEventListener("pointerdown",(function(){e.classList.add("using-mouse")}),{passive:!0}),e.addEventListener("keydown",(function(){e.classList.remove("using-mouse")}),{passive:!0})}}();
/**
* Raya Rivera — Unified Form Handler v1.0 — Replaces CF7, snippet #157313, all legacy handlers
*
* WPCode-ready. Attach via WPCode snippet (Site Wide Footer, JavaScript).
* Requires server-side companion: admin-ajax handler for 'rr_unified_lead' action.
*/
(function () {
'use strict';
const RR_FORM_CONFIG = {
ghlEndpoint: '/wp-admin/admin-ajax.php',
action: 'rr_unified_lead',
nonce: typeof rrFormNonce !== 'undefined' ? rrFormNonce : '',
turnstileSiteKey: '',
phone: '(859) 710-9033',
successMessages: {
contact: "Thanks! I'll be in touch within the hour.",
'home-value': "Got it! Your personalized home value report will be in your inbox within 24 hours.",
consultation: "You're all set! I'll reach out shortly to confirm your consultation.",
'open-house': "You're registered! I'll send you the details shortly.",
default: "Thanks for reaching out! I'll be in touch soon."
}
};
/* ───────── Selectors ───────── */
const KNOWN_IDS = [
'homeValueForm',
'contactForm',
'buyerForm',
'openHouseForm',
'rr-consultation-form',
'rr-sell-form',
'raya-home-value-form',
'home-value-form'
];
/* ───────── Utilities ───────── */
function stripPhone(val) {
return (val || '').replace(/\D/g, '');
}
function formatPhone(digits) {
if (digits.length === 10) {
return '(' + digits.slice(0, 3) + ') ' + digits.slice(3, 6) + '-' + digits.slice(6);
}
if (digits.length === 11 && digits[0] === '1') {
return '(' + digits.slice(1, 4) + ') ' + digits.slice(4, 7) + '-' + digits.slice(7);
}
return digits;
}
function isValidEmail(str) {
return /^[^\s@]+@[^\s@]+\.[^\s@]+$/.test(str);
}
function resolveFormType(form) {
var type = form.getAttribute('data-form-type');
if (type) return type;
var id = form.id || '';
if (/home.?value/i.test(id)) return 'home-value';
if (/contact/i.test(id)) return 'contact';
if (/buyer/i.test(id)) return 'buyer';
if (/open.?house/i.test(id)) return 'open-house';
if (/consultation/i.test(id)) return 'consultation';
if (/sell/i.test(id)) return 'home-value';
// Field-signature detection: address + timeline = sell/home-value form
var hasAddress = !!form.querySelector('[name*="address"], [name*="street"]');
var hasTimeline = !!form.querySelector('[name*="timeline"], [name*="timeframe"]');
if (hasAddress && hasTimeline) return 'home-value';
return 'contact';
}
function getSuccessMessage(type) {
return RR_FORM_CONFIG.successMessages[type] || RR_FORM_CONFIG.successMessages.default;
}
/* ───────── Analytics ───────── */
function pushEvent(eventName, data) {
window.dataLayer = window.dataLayer || [];
window.dataLayer.push(Object.assign({ event: eventName }, data));
}
/* ───────── Turnstile ───────── */
function injectTurnstile(form) {
if (!RR_FORM_CONFIG.turnstileSiteKey) return;
// Load Turnstile script once
if (!document.querySelector('script[src*="turnstile"]')) {
var s = document.createElement('script');
s.src = 'https://challenges.cloudflare.com/turnstile/v0/api.js';
s.async = true;
s.defer = true;
document.head.appendChild(s);
}
// Render widget before submit button
var submit = form.querySelector('[type="submit"], button[type="submit"], .rr-form__submit');
if (!submit) return;
if (form.querySelector('.cf-turnstile')) return; // already rendered
var widget = document.createElement('div');
widget.className = 'cf-turnstile';
widget.setAttribute('data-sitekey', RR_FORM_CONFIG.turnstileSiteKey);
submit.parentNode.insertBefore(widget, submit);
}
function getTurnstileToken(form) {
var el = form.querySelector('.cf-turnstile');
if (!el) return '';
var input = el.querySelector('[name="cf-turnstile-response"]');
return input ? input.value : '';
}
/* ───────── Validation ───────── */
function clearFieldError(field) {
field.classList.remove('error');
var msg = field.parentElement ? field.parentElement.querySelector('.rr-form__error') : null;
if (msg) msg.textContent = '';
}
function setFieldError(field, message) {
field.classList.add('error');
var container = field.parentElement;
if (!container) return;
var msg = container.querySelector('.rr-form__error');
if (!msg) {
msg = document.createElement('span');
msg.className = 'rr-form__error';
container.appendChild(msg);
}
msg.textContent = message;
}
function validateForm(form) {
var errors = [];
var required = form.querySelectorAll('[required]');
for (var i = 0; i < required.length; i++) {
var field = required[i];
clearFieldError(field);
var val = (field.value || '').trim();
if (field.type === 'checkbox') {
if (!field.checked) {
setFieldError(field, 'This field is required.');
errors.push(field);
}
continue;
}
if (!val) {
setFieldError(field, 'This field is required.');
errors.push(field);
continue;
}
if (field.type === 'email' && !isValidEmail(val)) {
setFieldError(field, 'Please enter a valid email address.');
errors.push(field);
continue;
}
if (field.type === 'tel' || field.name === 'phone' || /phone/i.test(field.name)) {
if (stripPhone(val).length < 10) {
setFieldError(field, 'Please enter a valid phone number (10+ digits).');
errors.push(field);
continue;
}
}
}
// Transactional consent checkbox — must be checked (handle all naming conventions)
var txConsent = form.querySelector('[name="smsConsentTransactional"], [name="sms_consent"], [name="tcpa-consent"]');
if (txConsent && !txConsent.checked) {
setFieldError(txConsent, 'Transactional consent is required.');
errors.push(txConsent);
}
// Turnstile validation
if (RR_FORM_CONFIG.turnstileSiteKey && !getTurnstileToken(form)) {
var tsEl = form.querySelector('.cf-turnstile');
if (tsEl) {
var tsErr = document.createElement('span');
tsErr.className = 'rr-form__error';
tsErr.textContent = 'Please complete the security check.';
tsEl.appendChild(tsErr);
errors.push(tsEl);
}
}
if (errors.length) {
errors[0].scrollIntoView({ behavior: 'smooth', block: 'center' });
if (errors[0].focus) errors[0].focus();
}
return errors.length === 0;
}
/* ───────── Submission ───────── */
function submitForm(form) {
var type = resolveFormType(form);
var submitBtn = form.querySelector('[type="submit"], button[type="submit"], .rr-form__submit');
// Disable button
if (submitBtn) {
submitBtn.disabled = true;
submitBtn.setAttribute('data-original-text', submitBtn.textContent);
submitBtn.textContent = 'SENDING...';
}
// Build FormData
var fd = new FormData(form);
fd.append('action', RR_FORM_CONFIG.action);
// Read nonce at submit time (not parse time) in case jQuery loaded after us
var nonce = (typeof rrFormNonce !== 'undefined') ? rrFormNonce : RR_FORM_CONFIG.nonce;
fd.append('nonce', nonce);
fd.append('form_type', type);
fd.append('page_url', window.location.href);
fd.append('referrer', document.referrer || '');
// Consent tags (handle all naming conventions)
var tags = [];
var txConsent = form.querySelector('[name="smsConsentTransactional"], [name="sms_consent"], [name="tcpa-consent"]');
if (txConsent && txConsent.checked) tags.push('sms:consent-transactional');
var mktConsent = form.querySelector('[name="smsConsentMarketing"], [name="marketing_consent"]');
if (mktConsent && mktConsent.checked) tags.push('sms:consent-marketing');
if (tags.length) fd.append('consent_tags', tags.join(','));
// Turnstile token
if (RR_FORM_CONFIG.turnstileSiteKey) {
var token = getTurnstileToken(form);
if (token) fd.append('cf-turnstile-response', token);
}
// Analytics
pushEvent('form_submission', { form_type: type, form_page: location.pathname });
// Send
fetch(RR_FORM_CONFIG.ghlEndpoint, {
method: 'POST',
body: fd,
credentials: 'same-origin'
})
.then(function (res) {
return res.json().then(function (data) {
return { status: res.status, data: data };
});
})
.then(function (result) {
var status = result.status;
var data = result.data;
if ((status === 200 && data.success) || status === 400) {
// 400 = duplicate contact, still treat as success
showSuccess(form, type);
} else {
showError(form, submitBtn, (data && data.data && data.data.message) || 'Something went wrong. Please try again.');
}
})
.catch(function () {
showError(form, submitBtn, 'Network error. Please check your connection and try again.');
});
}
function showSuccess(form, type) {
// Hide form fields
form.style.display = 'none';
// Show success element
var parent = form.parentElement;
var successEl = parent ? parent.querySelector('.rr-form__success') : null;
if (successEl) {
successEl.classList.add('active');
successEl.textContent = getSuccessMessage(type);
} else if (parent) {
// Create success element if none exists
successEl = document.createElement('div');
successEl.className = 'rr-form__success active';
successEl.textContent = getSuccessMessage(type);
parent.appendChild(successEl);
}
}
function showError(form, submitBtn, message) {
// Show form-level error
var errEl = form.querySelector('.rr-form__form-error');
if (!errEl) {
errEl = document.createElement('div');
errEl.className = 'rr-form__form-error';
form.appendChild(errEl);
}
errEl.textContent = message;
// Re-enable button
if (submitBtn) {
submitBtn.disabled = false;
submitBtn.textContent = submitBtn.getAttribute('data-original-text') || 'Submit';
}
}
/* ───────── Phone Formatter ───────── */
function attachPhoneFormatter(form) {
var phoneFields = form.querySelectorAll('input[type="tel"], input[name*="phone"]');
for (var i = 0; i < phoneFields.length; i++) {
phoneFields[i].addEventListener('blur', function () {
var digits = stripPhone(this.value);
if (digits.length >= 10) {
this.value = formatPhone(digits);
}
});
}
}
/* ───────── Form Start Tracking ───────── */
function trackFormStart(form, type) {
var tracked = false;
var inputs = form.querySelectorAll('input, textarea, select');
for (var i = 0; i < inputs.length; i++) {
inputs[i].addEventListener('focus', function () {
if (!tracked) {
tracked = true;
pushEvent('form_start', { form_type: type });
}
});
}
}
/* ───────── Clear Errors on Focus ───────── */
function attachClearOnFocus(form) {
var inputs = form.querySelectorAll('input, textarea, select');
for (var i = 0; i < inputs.length; i++) {
inputs[i].addEventListener('focus', function () {
clearFieldError(this);
});
}
}
/* ───────── Cleanup ───────── */
function removeOldHandlers(form) {
// Clone and replace to strip all existing event listeners
var clone = form.cloneNode(true);
form.parentNode.replaceChild(clone, form);
return clone;
}
function removeLegacyElements(form) {
// Remove old .cs-legal disclaimer divs
var legacyDisclaimers = form.querySelectorAll('.cs-legal');
for (var i = 0; i < legacyDisclaimers.length; i++) {
legacyDisclaimers[i].parentNode.removeChild(legacyDisclaimers[i]);
}
}
/* ───────── Init ───────── */
function init() {
var forms = [];
// Collect forms by class
var byClass = document.querySelectorAll('.rr-form');
for (var i = 0; i < byClass.length; i++) {
forms.push(byClass[i]);
}
// Collect forms by known IDs
for (var j = 0; j < KNOWN_IDS.length; j++) {
var el = document.getElementById(KNOWN_IDS[j]);
if (el && forms.indexOf(el) === -1) {
forms.push(el);
}
}
// Collect CF7 forms (intercept before CF7 handles them)
var cf7Forms = document.querySelectorAll('.wpcf7-form');
for (var c = 0; c < cf7Forms.length; c++) {
if (forms.indexOf(cf7Forms[c]) === -1) {
forms.push(cf7Forms[c]);
}
}
// Field-signature detection: forms with address + timeline fields
var allForms = document.querySelectorAll('form');
for (var k = 0; k < allForms.length; k++) {
var f = allForms[k];
if (forms.indexOf(f) !== -1) continue;
// Skip WP admin/search forms
if (f.id === 'adminbarsearch' || f.getAttribute('role') === 'search') continue;
var hasAddr = !!f.querySelector('[name*="address"], [name*="street"]');
var hasTime = !!f.querySelector('[name*="timeline"], [name*="timeframe"]');
if (hasAddr && hasTime) {
forms.push(f);
}
}
// Mark each form so we know it's ours
for (var m = 0; m < forms.length; m++) {
forms[m].setAttribute('data-rr-unified', 'true');
// Phone formatter
attachPhoneFormatter(forms[m]);
// Analytics — form start
trackFormStart(forms[m], resolveFormType(forms[m]));
// Clear errors on focus
attachClearOnFocus(forms[m]);
}
}
// Capture ALL form submissions at the document level BEFORE any other handler
// Using capture phase (true) means this fires before CF7, inline handlers, everything
document.addEventListener('submit', function (e) {
var form = e.target;
if (!form || form.tagName !== 'FORM') return;
// Skip admin/search forms
if (form.id === 'adminbarsearch' || form.getAttribute('role') === 'search') return;
// Check if this is a form we should handle
var isOurs = form.getAttribute('data-rr-unified') === 'true';
var isCF7 = form.classList.contains('wpcf7-form');
var isKnownId = KNOWN_IDS.indexOf(form.id) !== -1;
var hasLeadFields = !!form.querySelector('[name*="email"], [name="your-email"]');
if (isOurs || isCF7 || isKnownId || hasLeadFields) {
// Stop ALL other handlers from firing
e.preventDefault();
e.stopImmediatePropagation();
if (validateForm(form)) {
submitForm(form);
}
}
}, true); // true = capture phase, fires FIRST
// Run init on DOM ready to mark forms and attach formatters
if (document.readyState === 'loading') {
document.addEventListener('DOMContentLoaded', init);
} else {
init();
}
})();
var generatepressMenu = {"toggleOpenedSubMenus":true,"openSubMenuLabel":"Open Sub-Menu","closeSubMenuLabel":"Close Sub-Menu"};
//# sourceURL=generate-menu-js-before