import{getSortedMessages as e,setNestedProperty as r}from"../../utils.js";import{defineCodec as s}from"../ExtractorCodec.js";var t=s((()=>({decode(e){const r=JSON.parse(e),s=[];return o(r,((e,r)=>{s.push({id:r,message:e})})),s},encode(s){const t={};for(const o of e(s))r(t,o.id,o.message);return JSON.stringify(t,null,2)+"\n"},toJSONString:e=>e})));function o(e,r,s=""){for(const t of Object.keys(e)){const n=s?s+"."+t:t,a=e[t];if("string"==typeof a)r(a,n);else{if(Array.isArray(a))throw new Error(`Message at \`${n}\` resolved to an array, but only strings are supported. See https://next-intl.dev/docs/usage/translations#arrays-of-messages`);"object"==typeof a&&o(a,r,n)}}}export{t as default};