import a from"node:path";import{getNodeAttribute as u}from"../../../../markdoc/helpers/get-node-attribute.js";import{setNodeAttributeValue as f}from"../../../../markdoc/helpers/set-node-attribute-value.js";import{formatBundleFromMarkdocError as b}from"../errors.js";import{MdResolveError as d}from"./md-resolve-error.js";import{dereferenceJsonSchemaRefs as h}from"./helpers/dereference-json-schema-refs.js";async function k(o,r,e,{context:c,actions:i}){const l=u(o,r),t=i.contentDir,p=a.resolve(t,e),s=await h({schemaOrRef:l,filePath:p,fs:c.fs});f(o,r+"Resolved",s?.oas);const n=s?.problems[0];if(!n)return{};const m=b(n,e,t);throw f(o,r+"ResolvedErrors",[m]),new d(m,{rawLink:""})}export{k as resolveJsonSchemaRef};
