The region, as part of Lorraine, was part of the Holy Roman Empire, and then was gradually annexed by France in the 17th century, and formalized as one of the provinces of France. When did Stadtrepublik become a part of Alsace