"use strict";
/*
 * ATTENTION: The "eval" devtool has been used (maybe by default in mode: "development").
 * This devtool is neither made for production nor for readable output files.
 * It uses "eval()" calls to create a separate source file in the browser devtools.
 * If you are trying to read the output file, select a different devtool (https://webpack.js.org/configuration/devtool/)
 * or disable the default devtool with "devtool: false".
 * If you are looking for production-ready output files, see mode: "production" (https://webpack.js.org/configuration/mode/).
 */
(self["webpackChunk_mdts_frontend"] = self["webpackChunk_mdts_frontend"] || []).push([["node_modules_mermaid_dist_chunks_mermaid_core_pegDiagram-2B236MQR_mjs"],{

/***/ "./node_modules/mermaid/dist/chunks/mermaid.core/pegDiagram-2B236MQR.mjs"
/*!*******************************************************************************!*\
  !*** ./node_modules/mermaid/dist/chunks/mermaid.core/pegDiagram-2B236MQR.mjs ***!
  \*******************************************************************************/
(__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) {

eval("{__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* harmony export */   diagram: () => (/* binding */ diagram)\n/* harmony export */ });\n/* harmony import */ var _chunk_MOJQB5TN_mjs__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./chunk-MOJQB5TN.mjs */ \"./node_modules/mermaid/dist/chunks/mermaid.core/chunk-MOJQB5TN.mjs\");\n/* harmony import */ var _chunk_JWPE2WC7_mjs__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./chunk-JWPE2WC7.mjs */ \"./node_modules/mermaid/dist/chunks/mermaid.core/chunk-JWPE2WC7.mjs\");\n/* harmony import */ var _chunk_VAUOI2AC_mjs__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./chunk-VAUOI2AC.mjs */ \"./node_modules/mermaid/dist/chunks/mermaid.core/chunk-VAUOI2AC.mjs\");\n/* harmony import */ var _chunk_WYO6CB5R_mjs__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./chunk-WYO6CB5R.mjs */ \"./node_modules/mermaid/dist/chunks/mermaid.core/chunk-WYO6CB5R.mjs\");\n/* harmony import */ var _chunk_X3CZISLH_mjs__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ./chunk-X3CZISLH.mjs */ \"./node_modules/mermaid/dist/chunks/mermaid.core/chunk-X3CZISLH.mjs\");\n/* harmony import */ var _chunk_Y2CYZVJY_mjs__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ./chunk-Y2CYZVJY.mjs */ \"./node_modules/mermaid/dist/chunks/mermaid.core/chunk-Y2CYZVJY.mjs\");\n/* harmony import */ var _mermaid_js_parser__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! @mermaid-js/parser */ \"./node_modules/@mermaid-js/parser/dist/mermaid-parser.core.mjs\");\n\n\n\n\n\n\n\n// src/diagrams/railroad/parser/pegParser.ts\n\nvar langiumParser = (0,_mermaid_js_parser__WEBPACK_IMPORTED_MODULE_6__.createRailroadPegServices)().RailroadPeg.parser.LangiumParser;\nvar transformOrderedChoice = /* @__PURE__ */ (0,_chunk_Y2CYZVJY_mjs__WEBPACK_IMPORTED_MODULE_5__.__name)((choice) => {\n  const alternatives = choice.alternatives.map(transformSequence);\n  if (alternatives.length === 1) {\n    return alternatives[0];\n  }\n  return {\n    type: \"choice\",\n    alternatives\n  };\n}, \"transformOrderedChoice\");\nvar transformSequence = /* @__PURE__ */ (0,_chunk_Y2CYZVJY_mjs__WEBPACK_IMPORTED_MODULE_5__.__name)((sequence) => {\n  const elements = sequence.elements.map(transformPrefix);\n  if (elements.length === 1) {\n    return elements[0];\n  }\n  return {\n    type: \"sequence\",\n    elements\n  };\n}, \"transformSequence\");\nvar transformPrefix = /* @__PURE__ */ (0,_chunk_Y2CYZVJY_mjs__WEBPACK_IMPORTED_MODULE_5__.__name)((prefix) => {\n  const inner = transformSuffix(prefix.suffix);\n  if (!prefix.operator) {\n    return inner;\n  }\n  const label = prefix.operator === \"&\" ? `&${nodeToLabel(inner)}` : `!${nodeToLabel(inner)}`;\n  return {\n    type: \"special\",\n    text: label\n  };\n}, \"transformPrefix\");\nvar nodeToLabel = /* @__PURE__ */ (0,_chunk_Y2CYZVJY_mjs__WEBPACK_IMPORTED_MODULE_5__.__name)((node) => {\n  switch (node.type) {\n    case \"terminal\":\n      return `\"${node.value}\"`;\n    case \"nonterminal\":\n      return node.name;\n    case \"special\":\n      return node.text;\n    default:\n      return \"(...)\";\n  }\n}, \"nodeToLabel\");\nvar transformSuffix = /* @__PURE__ */ (0,_chunk_Y2CYZVJY_mjs__WEBPACK_IMPORTED_MODULE_5__.__name)((suffix) => {\n  const inner = transformPrimary(suffix.primary);\n  if (!suffix.operator) {\n    return inner;\n  }\n  switch (suffix.operator) {\n    case \"?\":\n      return { type: \"optional\", element: inner };\n    case \"*\":\n      return { type: \"repetition\", element: inner, min: 0, max: Infinity };\n    case \"+\":\n      return { type: \"repetition\", element: inner, min: 1, max: Infinity };\n    default:\n      throw new Error(`Unsupported PEG suffix operator: ${suffix.operator}`);\n  }\n}, \"transformSuffix\");\nvar transformPrimary = /* @__PURE__ */ (0,_chunk_Y2CYZVJY_mjs__WEBPACK_IMPORTED_MODULE_5__.__name)((primary) => {\n  switch (primary.$type) {\n    case \"PegLiteral\":\n      return {\n        type: \"terminal\",\n        value: primary.value\n      };\n    case \"PegIdentifier\":\n      return {\n        type: \"nonterminal\",\n        name: primary.name\n      };\n    case \"PegGroup\":\n      return transformOrderedChoice(primary.element);\n    case \"PegAny\":\n      return {\n        type: \"special\",\n        text: primary.dot\n      };\n    default:\n      throw new Error(`Unsupported PEG primary node: ${primary.$type}`);\n  }\n}, \"transformPrimary\");\nvar transformRule = /* @__PURE__ */ (0,_chunk_Y2CYZVJY_mjs__WEBPACK_IMPORTED_MODULE_5__.__name)((rule) => {\n  return {\n    name: rule.name,\n    definition: transformOrderedChoice(rule.definition)\n  };\n}, \"transformRule\");\nvar populateDb = /* @__PURE__ */ (0,_chunk_Y2CYZVJY_mjs__WEBPACK_IMPORTED_MODULE_5__.__name)((ast) => {\n  (0,_chunk_JWPE2WC7_mjs__WEBPACK_IMPORTED_MODULE_1__.populateCommonDb)(ast, _chunk_MOJQB5TN_mjs__WEBPACK_IMPORTED_MODULE_0__.db);\n  if (ast.title) {\n    _chunk_MOJQB5TN_mjs__WEBPACK_IMPORTED_MODULE_0__.db.setTitle(ast.title);\n  }\n  ast.rules.map((rule) => _chunk_MOJQB5TN_mjs__WEBPACK_IMPORTED_MODULE_0__.db.addRule(transformRule(rule)));\n}, \"populateDb\");\nvar parser = {\n  parse: /* @__PURE__ */ (0,_chunk_Y2CYZVJY_mjs__WEBPACK_IMPORTED_MODULE_5__.__name)((input) => {\n    _chunk_MOJQB5TN_mjs__WEBPACK_IMPORTED_MODULE_0__.db.clear();\n    _chunk_X3CZISLH_mjs__WEBPACK_IMPORTED_MODULE_4__.log.debug(\"[PEG Parser] Starting Langium parse\");\n    const result = langiumParser.parse(input);\n    if (result.lexerErrors.length > 0 || result.parserErrors.length > 0) {\n      throw new _mermaid_js_parser__WEBPACK_IMPORTED_MODULE_6__.MermaidParseError(result);\n    }\n    const ast = result.value;\n    _chunk_X3CZISLH_mjs__WEBPACK_IMPORTED_MODULE_4__.log.debug(\"[PEG Parser] Parsed rules:\", ast.rules.length);\n    populateDb(ast);\n    _chunk_X3CZISLH_mjs__WEBPACK_IMPORTED_MODULE_4__.log.debug(\"[PEG Parser] Parse complete\");\n  }, \"parse\"),\n  parser: {\n    yy: _chunk_MOJQB5TN_mjs__WEBPACK_IMPORTED_MODULE_0__.db\n  }\n};\n\n// src/diagrams/railroad/pegDiagram.ts\nvar diagram = {\n  parser,\n  db: _chunk_MOJQB5TN_mjs__WEBPACK_IMPORTED_MODULE_0__.db,\n  renderer: _chunk_MOJQB5TN_mjs__WEBPACK_IMPORTED_MODULE_0__.renderer,\n  styles: _chunk_MOJQB5TN_mjs__WEBPACK_IMPORTED_MODULE_0__.getStyles\n};\n\n\n\n//# sourceURL=webpack://@mdts/frontend/./node_modules/mermaid/dist/chunks/mermaid.core/pegDiagram-2B236MQR.mjs?\n}");

/***/ }

}]);