Which sentence uses a dash or dashes correctly?

While I was at the gym—wondering what machine—to use next I ran into my neighbor.

While I was at the gym wondering what machine to use next—I ran into my neighbor.

While I—was at the gym wondering what machine to use next—I ran into my neighbor.

While I was at the gym—wondering what machine to use next—I ran into my neighbor.