import f from"@markdoc/markdoc";import*as g from"@redocly/theme/markdoc/default";import{reporter as p}from"../../../tools/notifiers/reporter.js";import{includes as u}from"./functions/includes.js";import{importUserTags as d}from"./import-user-tags.js";import*as l from"./nodes/index.js";import h from"./tags/index.js";import{concat as O}from"./functions/concat.js";const y=g.tags;function b(o){return Object.fromEntries(Object.entries(o).map(([r,e])=>[e.tagName||r,e]))}function T(o){const{tags:r,functions:e={},...n}=o,a={...r,...n};let i=Object.entries(a);const s=[],t=[];for(const[c,m]of i)c in f.nodes?s.push([c,m]):t.push([c,m]);return{nodes:Object.fromEntries(s),tags:Object.fromEntries(t),functions:e}}async function D(o="../../../esbuild/cache/server/",r=""){let e;try{e=(await d(o)).schema}catch(t){throw t.code==="ERR_MODULE_NOT_FOUND"?(p.printErrors(),new Error("Please fix the errors above and try again.")):t}const{tags:n={},nodes:a={},functions:i={}}=T(e),s={tags:{schemaDefinition:{render:"SchemaDefinition",attributes:{schemaRef:{type:String},exampleRef:{type:String},showReadOnly:{type:Boolean},showWriteOnly:{type:Boolean}}}}};return{nodes:{...l,...a},tags:{...h,...y,...b(n),...s.tags},functions:{...f.functions,...i,includes:u,concat:O}}}export{D as getMarkdocOptions};
