Measurable selection for argmin to distance

Let $$Y$$ be a Banach space and equip $$Y$$ with the weak topology. Now, let $$X$$ be a closed, bounded, and convex subset of $$Y$$ and suppose that the relative (weak) topology on $$X$$ is metrizable with metric $$d_X$$. Let $$x_1,\dots,x_n \in X$$ for some natural $$n>0$$.

Let $$\emptyset\neq Z\subseteq X$$ be a compact subset of $$X$$. Then, does the map $$x\mapsto \min_{1\leq i\leq n}\, d_X(x_i,x)$$ admit a measurable selection? I.e.: Does there exist a measurable function $$S\mapsto \{1,\dots,n\} \mbox{ s.t. } d_{X}(x_{S(x)},x)=\min_{i=1,\dots,n} d_{X}(x_i,x)$$ for all $$x\in Z$$ and $$S$$ is measurable as a function from $$Z$$ to $$\{1,\dots,n\}$$ (where the latter has the $$\sigma$$-algebra $$2^{\{1,\dots,n\}}$$?)

Here is a simple direct argument. For $$i=1,\ldots,n$$, let $$C_i=\{z\in Z\mid d(z,x_i)\leq d(z,x_j), j=1,\ldots,n\}.$$ Clearly, each $$C_i$$ is closed and hence measurable. Let $$M_i=C_i\setminus\bigcup_{l=1}^{i-1}C_l$$. The nonempty sets of the form $$M_i$$ form a finite measurable partition of $$Z$$. Now let $$S$$ map each $$M_i$$ to $$x_i$$.