A mass $m$ starts from rest and slides a distance $d$ down a frictionless incline of angle $\theta .$ While sliding, it contacts an unstressed spring of negligible mass, as shown in Figure $\mathrm{P8} .11 .$ The mass slides an additional distance $x$ as it
is brought momentarily to rest by compression of the spring (of force constant $k$ ). Find the initial separation $d$ between the mass and the spring.