const { Header, Card, Button, Badge, Input, Select, Radio } = window.AcornTitleDesignSystem_b6a569; function SiteFooter() { return ( ); } const headerLinks = () => [ { label: 'Home', href: 'Acorn Homepage.html' }, { label: 'Buying', href: 'Buying.html' }, { label: 'Selling', href: 'Selling.html' }, { label: 'For Professionals', href: 'For Professionals.html' }, { label: 'About', href: 'About.html' }, { label: 'Contact', href: 'Contact.html' }, ]; const logoSizeOverride = ; function AppQuickLink() { React.useEffect(() => { const header = document.querySelector('header'); if (!header) return; const rightGroup = header.querySelector(':scope > div > div:last-child'); if (!rightGroup || rightGroup.querySelector('.app-quick-link')) return; const a = document.createElement('a'); a.href = 'https://app.acorn-title.com'; a.target = '_blank'; a.rel = 'noopener'; a.className = 'app-quick-link'; a.setAttribute('aria-label', 'Open the Acorn App'); a.style.cssText = 'display:flex;align-items:center;justify-content:center;width:42px;height:42px;flex-shrink:0;color:inherit'; a.innerHTML = ''; rightGroup.insertBefore(a, rightGroup.firstChild); return () => a.remove(); }, []); return null; } function LogoHomeLink() { React.useEffect(() => { const header = document.querySelector('header'); if (!header) return; const img = header.querySelector('img[alt="Acorn Title"]'); if (!img || img.closest('a')) return; const a = document.createElement('a'); a.href = 'Acorn Homepage.html'; a.setAttribute('aria-label', 'Acorn Title home'); a.style.cssText = 'display:flex;align-items:center'; img.parentNode.insertBefore(a, img); a.appendChild(img); return () => { if (a.parentNode) { a.parentNode.insertBefore(img, a); a.remove(); } }; }, []); return null; } function Eyebrow({ children }) { return
{children}
; } function SectionHeading({ children }) { return

{children}

; } function StepBadge({ n }) { return
{n}
; } function FormSection({ n, title, structure, density, last, children }) { if (structure === 'stepped') { return (

{title}

{children}
); } return ( {title} {children} {!last &&
} ); } function Field({ label, error, children }) { return (
{label && } {children} {error &&
{error}
}
); } function Row({ children, gap = 32 }) { return
{children}
; } function liveCurrency(v) { const digits = v.replace(/[^0-9]/g, ''); return digits ? '$' + Number(digits).toLocaleString('en-US') : ''; } function UploadZone({ files, onFiles }) { const [drag, setDrag] = React.useState(false); const inputRef = React.useRef(null); return (
{ e.preventDefault(); setDrag(true); }} onDragLeave={() => setDrag(false)} onDrop={(e) => { e.preventDefault(); setDrag(false); onFiles([...e.dataTransfer.files]); }} onClick={() => inputRef.current?.click()} style={{ border: '1.5px dashed var(--border-strong)', borderRadius: 'var(--radius-md)', padding: '40px 24px', textAlign: 'center', cursor: 'pointer', background: 'var(--surface-page)', transition: 'all var(--duration-fast) var(--ease-standard)', }} >
Drag and drop your contract here
or click to browse (PDF, DOCX, JPG, or PNG)
onFiles([...e.target.files])} />
{files.length > 0 && (
{files.map((f, i) => (
{f.name}
))}
)}
); } const propertyTypes = [ { value: '', label: 'Select property type' }, { value: 'residential', label: 'Residential' }, { value: 'commercial', label: 'Commercial' }, { value: 'vacant-land', label: 'Vacant Land' }, { value: 'investment', label: 'Investment Property' }, { value: 'new-construction', label: 'New Construction' }, { value: 'other', label: 'Other' }, ]; const friendlyRequired = { firstName: 'Please share your first name so we know who we\u2019re working with.', lastName: 'Please share your last name so we know who we\u2019re working with.', email: 'Please enter an email address so we can reach you.', phone: 'Please enter a phone number so we can reach you.', company: 'Please let us know your company name.', sellerName: 'Please enter the seller\u2019s name.', buyerName: 'Please enter the buyer\u2019s name.', propertyType: 'Please choose the property type.', propertyAddress: 'Please enter the property address so we know where to begin.', city: 'Please enter the property city.', zip: 'Please enter the property ZIP code.', salesPrice: 'Please enter the sales price.', }; const DENSITY = { relaxed: { cardPad: 'var(--space-8) var(--space-7)', sectionGap: 'var(--space-7)', rowGap: 24, headingMb: 'var(--space-6)' }, efficient: { cardPad: 'var(--space-6) var(--space-6)', sectionGap: 'var(--space-5)', rowGap: 14, headingMb: 'var(--space-4)' }, }; function OrderForm({ onSubmitted, structure, densityKey }) { const density = DENSITY[densityKey]; const [data, setData] = React.useState({ firstName: '', lastName: '', email: '', phone: '', company: '', sellerName: '', buyerName: '', propertyType: '', propertyAddress: '', city: '', zip: '', salesPrice: '', lender: '', loanAmount: '', contractLink: '', comments: '', smsOptIn: '', }); const [files, setFiles] = React.useState([]); const [errors, setErrors] = React.useState({}); const [submitting, setSubmitting] = React.useState(false); const [submitError, setSubmitError] = React.useState(''); const fieldRefs = React.useRef({}); const set = (k) => (e) => setData((d) => ({ ...d, [k]: e.target.value })); const setMoney = (k) => (e) => setData((d) => ({ ...d, [k]: liveCurrency(e.target.value) })); const validate = () => { const next = {}; Object.keys(friendlyRequired).forEach((k) => { if (!String(data[k]).trim()) next[k] = friendlyRequired[k]; }); setErrors(next); return next; }; const handleSubmit = (e) => { e.preventDefault(); const next = validate(); const firstKey = Object.keys(friendlyRequired).find((k) => next[k]); if (firstKey) { fieldRefs.current[firstKey]?.scrollIntoView({ behavior: 'smooth', block: 'center' }); return; } setSubmitting(true); setSubmitError(''); const form = new FormData(); form.append('form_type', 'order-title'); Object.entries(data).forEach(([k, v]) => form.append(k, v)); files.forEach((f) => form.append('files[]', f)); fetch('submit-form.php', { method: 'POST', body: form }) .then((r) => r.json()) .then((res) => { setSubmitting(false); if (res.success) { onSubmitted({ ...data, files }); } else { setSubmitError(res.message || 'Something went wrong. Please try again.'); } }) .catch(() => { setSubmitting(false); setSubmitError('Something went wrong. Please try again or reach us by phone.'); }); }; const reg = (k) => (el) => { fieldRefs.current[k] = el; }; const sections = (