import{SEARCH_GROUP_FACET_FIELD as f}from"../../../../constants/common.js";import{SEARCH_GROUP_NAME_API as u}from"../../../constants/plugins/search.js";function h(t,o,s){const e=o();for(const[n,r]of Object.entries(t)){const c=e.get(n);if(c){const i=new Set(c.values??[]);r instanceof Set?[...r].forEach(a=>c.values=Array.from(i.add(a))):c.values=Array.from(i.add(r))}}s(e)}function p(t,o,s){const e={[f]:u,apiTitle:o.title,apiVersion:o.version?.toString()};if(!t)return e;const n=s();for(const[r,c]of Object.entries(t))n.has(r)&&(e[r]=String(c));return t.title&&(e.apiTitle=t.title),e}export{p as extractDocumentSearchFacets,h as setDocumentSearchFacets};
