import{mapOptions as e,mapParseResult as t,mapResult as n,preprocessStyles as r}from"./shared.mjs";import{compileAstro as i,parseAstro as a}from"@astrojs/compiler-binding";async function o(t,r){let a=n(await i(t,e(r)),r?.preprocessedStyles);if(typeof r?.resolvePath==`function`){let e=r.resolvePath,t=[...a.hydratedComponents,...a.clientOnlyComponents,...a.serverComponents];for(let n of t)n.resolvedPath=await e(n.specifier);let{code:n}=a;for(let e of t)e.resolvedPath&&e.resolvedPath!==e.specifier&&(n=n.split(`"client:component-path": "${e.specifier}"`).join(`"client:component-path": "${e.resolvedPath}"`));a.code=n}return a}async function s(e){return t(await a(e))}async function c(e){throw Error(`convertToTSX() is not yet implemented in the Rust compiler`)}export{c as convertToTSX,s as parse,r as preprocessStyles,o as transform};