// ../aot-compiler/dist/chunk-PPZXJJ57.js
var CoreParserAdapter = class {
  constructor(api, converter) {
    this.api = api;
    this.converter = converter;
  }
  /**
   * Parse hyperscript code to an AOT-compatible AST.
   */
  parse(code, language) {
    const result = this.api.compileSync(code, {
      language: language ?? "en",
      traditional: true
    });
    if (!result.ok || !result.ast) {
      throw new Error(result.errors?.[0]?.message ?? `Core parser failed for: ${code}`);
    }
    return this.converter(result.ast);
  }
};
var _converter = null;
function convertCoreASTToAOT(node) {
  if (_converter) return _converter(node);
  return node;
}
async function createCoreParserAdapter() {
  const core = await import("./dist-KBC4YRQJ.js");
  const api = core.hyperscript ?? core.default ?? core;
  if (!api?.compileSync) {
    throw new Error(
      "@hyperfixi/core does not export compileSync. Ensure @hyperfixi/core >= 1.0.0 is installed."
    );
  }
  const converter = core.fromCoreAST;
  if (!converter) {
    throw new Error(
      "@hyperfixi/core does not export fromCoreAST. Ensure @hyperfixi/core >= 1.3.0 is installed."
    );
  }
  _converter = converter;
  return new CoreParserAdapter(api, converter);
}

export {
  CoreParserAdapter,
  convertCoreASTToAOT,
  createCoreParserAdapter
};
//# sourceMappingURL=chunk-UQULNKOC.js.map