# Code Summary — contact-form (U4) ## What was built - **Movable package `src/cms-client/`** (no imports from the app; ESLint `no-restricted-imports` plus a boundary test): `http/` (`apiUrl`, `fetchJson` with 10 s timeout, problem+json parsing), `contact/` (`validateContact`, `contactFormReducer`, `createContactClient`, `messages.nl`, `useContactForm`, types), `README.md`. - **Validation** equal to the API (trim; 100/254/100/2000; email regex; control characters rejected except line breaks in the message; first failing rule per field). **Reducer**: `sent` only leaves through `reset`; edits and a second submit are ignored while `sending`; input is kept on `failed`. - **Client**: `getToken` (200 → token, 404 → closed, anything else → failed, malformed body → failed) and `submit` (202 ok; 400 → field errors or token expired; 413; 404; 429 with `Retry-After`; 5xx/network → failed). Never throws, never logs. - **Hook `useContactForm`**: prop getters with ids from `idPrefix`, `aria-invalid`/`aria-describedby`, honeypot props (silent success without a request when filled), one idempotency key per attempt series (reused on retry, renewed after success/reset), a single automatic token refresh on `expired`, preselect with change counter (unknown values ignored), focus on the first invalid field after the render, telemetry only through `onEvent('sent' | 'failed')`. - **UI**: `ContactPanel` (mailto panel by default, upgrades to the form when `GET …/token` answers 200 without captcha; min height 280px), `MailtoPanel`, `ContactFormView` (design B: panel colours, underline inputs on `bg-field`, brand submit button, errors outside the labels, `role=alert` failure with the mail address, `role=status` success with focus, privacy sentence), hidden honeypot field. `useContactAvailability` starts the token request when the section nears the viewport (IntersectionObserver, `rootMargin 300px`), or on first focus without IntersectionObserver. Subject options = offerings (slug/title) + "Overig". `trackEvent('contact-sent' | 'contact-failed')` without data. - **Tokens**: new `--color-danger` (error text) in all four sets, contrast-tested against `panel` and `field`. - **Dependencies**: `fast-check` (dev) for property-based tests; no runtime dependency. ## Verification (Step 13.5, real output) - Before this unit (after U3): 14 files / 154 tests. After: **19 files / 239 tests passed**; `pnpm lint` 0 errors (same 2 existing warnings, boundary rule active); `pnpm build` OK (JS 466 kB, CSS 58.8 kB). - Found and fixed by the tests: (1) field errors inside the `