function u(s,i){return s?s.map(o=>{const t=i?.[o.property];if(t&&t.length>0)return{...o,options:t};if(!(o.options&&o.options.length>0))return{...o,options:[]};const n=o.options[0];if(typeof n=="object"&&n!==null&&"value"in n&&"count"in n)return{...o,options:o.options};const c=Object.fromEntries(o.options.map(p=>[p,0])),e=Object.entries(c).map(([p,r])=>({value:p,count:r}));return{...o,options:e}}):[]}export{u as collectFilterOptions};
