import l from"@markdoc/markdoc";import{REDOCLY_ROUTE_RBAC as u,REDOCLY_TEAMS_RBAC as A}from"@redocly/config";import{getSearchDocuments as R}from"./get-search-documents.js";import{walkSections as S}from"./walk-sections.js";import{setDocumentSearchFacets as C,extractDocumentSearchFacets as _}from"./search-facets.js";import{getInnerText as d}from"../../../../shared/markdoc.js";import{MARKDOC_PARTIALS_DATA_KEY as g}from"../../../store.js";function I(t,m,o,c){return async(r,e,s)=>{if(t?.excludeFromSearch)return[];const a=l.Ast.fromJSON(e.ast),i=S({node:a,getInnerContent:d,partials:s.getGlobalConfig(g)||{}}),f=r.metadata||{},n=_(f,o);C(n,o,c);const p=t?.seo?.title||m;return R(i,r.slug,p,e[A],e[u],n)}}export{I as searchResolver};
