import { AbstractMermaidTokenBuilder, __name, AbstractMermaidValueConverter, MermaidGeneratedSharedModule, PieGeneratedModule } from './chunk-FPAJGGOC.mjs';
import { EmptyFileSystem } from '../../../../../../../langium@3.3.1/node_modules/langium/lib/workspace/file-system-provider.mjs';
import { inject } from '../../../../../../../langium@3.3.1/node_modules/langium/lib/dependency-injection.mjs';
import { createDefaultSharedCoreModule, createDefaultCoreModule } from '../../../../../../../langium@3.3.1/node_modules/langium/lib/default-module.mjs';

// src/language/pie/tokenBuilder.ts
var PieTokenBuilder = class extends AbstractMermaidTokenBuilder {
  static {
    __name(this, "PieTokenBuilder");
  }
  constructor() {
    super(["pie", "showData"]);
  }
};

// src/language/pie/valueConverter.ts
var PieValueConverter = class extends AbstractMermaidValueConverter {
  static {
    __name(this, "PieValueConverter");
  }
  runCustomConverter(rule, input, _cstNode) {
    if (rule.name !== "PIE_SECTION_LABEL") {
      return void 0;
    }
    return input.replace(/"/g, "").trim();
  }
};

// src/language/pie/module.ts
var PieModule = {
  parser: {
    TokenBuilder: /* @__PURE__ */ __name(() => new PieTokenBuilder(), "TokenBuilder"),
    ValueConverter: /* @__PURE__ */ __name(() => new PieValueConverter(), "ValueConverter")
  }
};
function createPieServices(context = EmptyFileSystem) {
  const shared = inject(
    createDefaultSharedCoreModule(context),
    MermaidGeneratedSharedModule
  );
  const Pie = inject(
    createDefaultCoreModule({ shared }),
    PieGeneratedModule,
    PieModule
  );
  shared.ServiceRegistry.register(Pie);
  return { shared, Pie };
}
__name(createPieServices, "createPieServices");

export { PieModule, createPieServices };
