1. The function
$$
f(x)=(\sin x-1)(\cos x-1)(x \in \mathbf{R})
$$

has the range $\qquad$ .
$-1 .\left[0, \frac{3+2 \sqrt{2}}{2}\right]$.
It is easy to know, $f(x)=\sin x \cdot \cos x-(\sin x+\cos x)+1$.
Let $t=\sin x+\cos x \in[-\sqrt{2}, \sqrt{2}]$.
Then $\sin x \cdot \cos x=\frac{t^{2}-1}{2}$.
Therefore, $f(x)=\frac{t^{2}-1}{2}-t+1$
$=\frac{1}{2}(t-1)^{2} \in\left[0, \frac{3+2 \sqrt{2}}{2}\right]$.