"use strict";var y=/^[!#$%&'*+\-.^_`|~0-9A-Za-z]+$/,i=/[\r\n\0]/;function u(t){let e,r={};if(!t||"object"!=typeof t||Array.isArray(t))return r;try{e=Object.keys(t)}catch{return r}let n=0;for(let f of e){let e,o;if("string"!=typeof f||!y.test(f))continue;try{e=t[f]}catch{continue}if("string"==typeof e)o=e;else{if("number"!=typeof e&&"boolean"!=typeof e)continue;o=String(e)}if(i.test(o))continue;let c=Buffer.byteLength(f,"utf8")+Buffer.byteLength(o,"utf8");n+c>8192||(n+=c,r[f]=o)}return r}module.exports={validateOtelHeaders:u,MAX_TOTAL_BYTES:8192};