from editing import *
import re
for p in ['resources/js/pages/admin/Entreprises/Form.vue','resources/js/pages/admin/Entreprises/Products.vue']:
 s=read(p)
 m=re.search(r'\(\{ (?:type_production_ids|specificite_ids):.*?\} as Record<string, string>\)\[key\]',s)
 if not m:raise ValueError(p)
 obj=m.group().replace('(', '',1).replace(' as Record<string, string>)[key]','')
 s=s.replace('</script>',f'const classificationLabels: Record<string, string> = {obj};\n</script>').replace(m.group(),'classificationLabels[key]')
 write(p,s)
