import{getTagGroupsItems,getTagsItems,getTagsWithOperations}from"./tags";import{addMarkdownItems}from"./markdown";import{flattenByProp,getValueFromMdParsedExtension}from"../../utils";export function buildMenuStructure(t,e){var o,i,n;const{definition:s}=t,{schemaDefinitionsTagName:r}=e,d=[{id:"",name:(null===(i=null===(o=null==s?void 0:s.info)||void 0===o?void 0:o["x-seo"])||void 0===i?void 0:i.title)||(null===(n=null==s?void 0:s.info)||void 0===n?void 0:n.title)||"Overview",href:"/",depth:1,level:1,type:"section",infoDefinition:s.info,items:[]}],a=[...s.tags||[]];!a.find((t=>(null==t?void 0:t.name)===r))&&r&&a.push({name:r});const u=getTagsWithOperations(t,a),l=s["x-tagGroups"];return d.push(...addMarkdownItems(getValueFromMdParsedExtension(s.info,"description")||"",void 0,1)),l&&l.length>0?d.push(...getTagGroupsItems(t,void 0,l,u,e)):d.push(...getTagsItems(t,u,void 0,void 0,e)),d}export function buildContentItems(t,e){const o=buildMenuStructure(t,e);return{contentItems:o,flatItems:flattenByProp(o||[],"items")}}
//# sourceMappingURL=builder.js.map