Pan got turned into a doll while trying to take a Dragon Ball inside Luud's Castle. She remained in that way until reverted in episode 14.
While trying to get hold of the six-star Dragon Ball inside Luud's Castle in the Planet Luud, Pan was turned into a doll by the chief of the Luud Cult, Cardinal Muchi Muchi. Apparently the dolls are used as the energy source for the cult's diety, Lord Luud which later revealed actually is a robot. Pan however being picked up by the cult's chief leader Dolltaki for his personal collection.
Episode 12 mainly shows Pan's situation under Dolltaki's collection until both of them got absorbed in the following episode. They later finally reverted back in episode 14.
Despite being reduced to a doll, Pan is aware of her predicament as shown by her monologues during her entire time as a doll.