summaryrefslogtreecommitdiff
path: root/themes/blowfish/assets/lib/mermaid/mermaidAPI-b17c596d.js.map
blob: 5f37889c55eb5f8445ca043d3c884a9ab19083c6 (plain)
1
{"version":3,"file":"mermaidAPI-b17c596d.js","sources":["../src/diagrams/c4/c4Detector.ts","../src/diagrams/flowchart/flowDetector.ts","../src/diagrams/flowchart/flowDetector-v2.ts","../src/diagrams/er/erDetector.ts","../src/diagrams/git/gitGraphDetector.ts","../src/diagrams/gantt/ganttDetector.ts","../src/diagrams/info/infoDetector.ts","../src/diagrams/pie/pieDetector.ts","../src/diagrams/requirement/requirementDetector.ts","../src/diagrams/sequence/sequenceDetector.ts","../src/diagrams/class/classDetector.ts","../src/diagrams/class/classDetector-V2.ts","../src/diagrams/state/stateDetector.ts","../src/diagrams/state/stateDetector-V2.ts","../src/diagrams/user-journey/journeyDetector.ts","../src/diagrams/error/errorDetector.ts","../src/diagrams/flowchart/elk/detector.ts","../src/diagrams/timeline/detector.ts","../src/diagrams/mindmap/detector.ts","../src/diagram-api/diagram-orchestration.ts","../src/Diagram.ts","../src/interactionDb.ts","../src/accessibility.ts","../src/mermaidAPI.ts"],"sourcesContent":["import type { ExternalDiagramDefinition } from '../../diagram-api/types';\n\nconst id = 'c4';\n\nconst detector = (txt: string) => {\n  return txt.match(/^\\s*C4Context|C4Container|C4Component|C4Dynamic|C4Deployment/) !== null;\n};\n\nconst loader = async () => {\n  const { diagram } = await import('./c4Diagram');\n  return { id, diagram };\n};\n\nconst plugin: ExternalDiagramDefinition = {\n  id,\n  detector,\n  loader,\n};\n\nexport default plugin;\n","import type { DiagramDetector, ExternalDiagramDefinition } from '../../diagram-api/types';\n\nconst id = 'flowchart';\n\nconst detector: DiagramDetector = (txt, config) => {\n  // If we have conferred to only use new flow charts this function should always return false\n  // as in not signalling true for a legacy flowchart\n  if (\n    config?.flowchart?.defaultRenderer === 'dagre-wrapper' ||\n    config?.flowchart?.defaultRenderer === 'elk'\n  ) {\n    return false;\n  }\n  return txt.match(/^\\s*graph/) !== null;\n};\n\nconst loader = async () => {\n  const { diagram } = await import('./flowDiagram');\n  return { id, diagram };\n};\n\nconst plugin: ExternalDiagramDefinition = {\n  id,\n  detector,\n  loader,\n};\n\nexport default plugin;\n","import type { DiagramDetector } from '../../diagram-api/types';\nimport type { ExternalDiagramDefinition } from '../../diagram-api/types';\n\nconst id = 'flowchart-v2';\n\nconst detector: DiagramDetector = (txt, config) => {\n  if (\n    config?.flowchart?.defaultRenderer === 'dagre-d3' ||\n    config?.flowchart?.defaultRenderer === 'elk'\n  ) {\n    return false;\n  }\n\n  // If we have configured to use dagre-wrapper then we should return true in this function for graph code thus making it use the new flowchart diagram\n  if (txt.match(/^\\s*graph/) !== null && config?.flowchart?.defaultRenderer === 'dagre-wrapper') {\n    return true;\n  }\n  return txt.match(/^\\s*flowchart/) !== null;\n};\n\nconst loader = async () => {\n  const { diagram } = await import('./flowDiagram-v2');\n  return { id, diagram };\n};\n\nconst plugin: ExternalDiagramDefinition = {\n  id,\n  detector,\n  loader,\n};\n\nexport default plugin;\n","import type { DiagramDetector, ExternalDiagramDefinition } from '../../diagram-api/types';\n\nconst id = 'er';\n\nconst detector: DiagramDetector = (txt) => {\n  return txt.match(/^\\s*erDiagram/) !== null;\n};\n\nconst loader = async () => {\n  const { diagram } = await import('./erDiagram');\n  return { id, diagram };\n};\n\nconst plugin: ExternalDiagramDefinition = {\n  id,\n  detector,\n  loader,\n};\n\nexport default plugin;\n","import type { DiagramDetector } from '../../diagram-api/types';\nimport type { ExternalDiagramDefinition } from '../../diagram-api/types';\n\nconst id = 'gitGraph';\n\nconst detector: DiagramDetector = (txt) => {\n  return txt.match(/^\\s*gitGraph/) !== null;\n};\n\nconst loader = async () => {\n  const { diagram } = await import('./gitGraphDiagram');\n  return { id, diagram };\n};\n\nconst plugin: ExternalDiagramDefinition = {\n  id,\n  detector,\n  loader,\n};\n\nexport default plugin;\n","import type { DiagramDetector, ExternalDiagramDefinition } from '../../diagram-api/types';\n\nconst id = 'gantt';\n\nconst detector: DiagramDetector = (txt) => {\n  return txt.match(/^\\s*gantt/) !== null;\n};\n\nconst loader = async () => {\n  const { diagram } = await import('./ganttDiagram');\n  return { id, diagram };\n};\n\nconst plugin: ExternalDiagramDefinition = {\n  id,\n  detector,\n  loader,\n};\n\nexport default plugin;\n","import type { DiagramDetector, ExternalDiagramDefinition } from '../../diagram-api/types';\n\nconst id = 'info';\n\nconst detector: DiagramDetector = (txt) => {\n  return txt.match(/^\\s*info/) !== null;\n};\n\nconst loader = async () => {\n  const { diagram } = await import('./infoDiagram');\n  return { id, diagram };\n};\n\nconst plugin: ExternalDiagramDefinition = {\n  id,\n  detector,\n  loader,\n};\n\nexport default plugin;\n","import type { DiagramDetector, ExternalDiagramDefinition } from '../../diagram-api/types';\n\nconst id = 'pie';\n\nconst detector: DiagramDetector = (txt) => {\n  return txt.match(/^\\s*pie/) !== null;\n};\n\nconst loader = async () => {\n  const { diagram } = await import('./pieDiagram');\n  return { id, diagram };\n};\n\nconst plugin: ExternalDiagramDefinition = {\n  id,\n  detector,\n  loader,\n};\n\nexport default plugin;\n","import type { DiagramDetector, ExternalDiagramDefinition } from '../../diagram-api/types';\n\nconst id = 'requirement';\n\nconst detector: DiagramDetector = (txt) => {\n  return txt.match(/^\\s*requirement(Diagram)?/) !== null;\n};\n\nconst loader = async () => {\n  const { diagram } = await import('./requirementDiagram');\n  return { id, diagram };\n};\n\nconst plugin: ExternalDiagramDefinition = {\n  id,\n  detector,\n  loader,\n};\n\nexport default plugin;\n","import type { DiagramDetector, ExternalDiagramDefinition } from '../../diagram-api/types';\n\nconst id = 'sequence';\n\nconst detector: DiagramDetector = (txt) => {\n  return txt.match(/^\\s*sequenceDiagram/) !== null;\n};\n\nconst loader = async () => {\n  const { diagram } = await import('./sequenceDiagram');\n  return { id, diagram };\n};\n\nconst plugin: ExternalDiagramDefinition = {\n  id,\n  detector,\n  loader,\n};\n\nexport default plugin;\n","import type { DiagramDetector, ExternalDiagramDefinition } from '../../diagram-api/types';\n\nconst id = 'class';\n\nconst detector: DiagramDetector = (txt, config) => {\n  // If we have configured to use dagre-wrapper then we should never return true in this function\n  if (config?.class?.defaultRenderer === 'dagre-wrapper') {\n    return false;\n  }\n  // We have not opted to use the new renderer so we should return true if we detect a class diagram\n  return txt.match(/^\\s*classDiagram/) !== null;\n};\n\nconst loader = async () => {\n  const { diagram } = await import('./classDiagram');\n  return { id, diagram };\n};\n\nconst plugin: ExternalDiagramDefinition = {\n  id,\n  detector,\n  loader,\n};\n\nexport default plugin;\n","import type { DiagramDetector, ExternalDiagramDefinition } from '../../diagram-api/types';\n\nconst id = 'classDiagram';\n\nconst detector: DiagramDetector = (txt, config) => {\n  // If we have configured to use dagre-wrapper then we should return true in this function for classDiagram code thus making it use the new class diagram\n  if (\n    txt.match(/^\\s*classDiagram/) !== null &&\n    config?.class?.defaultRenderer === 'dagre-wrapper'\n  ) {\n    return true;\n  }\n  // We have not opted to use the new renderer so we should return true if we detect a class diagram\n  return txt.match(/^\\s*classDiagram-v2/) !== null;\n};\n\nconst loader = async () => {\n  const { diagram } = await import('./classDiagram-v2');\n  return { id, diagram };\n};\n\nconst plugin: ExternalDiagramDefinition = {\n  id,\n  detector,\n  loader,\n};\n\nexport default plugin;\n","import type { DiagramDetector, ExternalDiagramDefinition } from '../../diagram-api/types';\n\nconst id = 'state';\n\nconst detector: DiagramDetector = (txt, config) => {\n  // If we have confirmed to only use new state diagrams this function should always return false\n  // as in not signalling true for a legacy state diagram\n  if (config?.state?.defaultRenderer === 'dagre-wrapper') {\n    return false;\n  }\n  return txt.match(/^\\s*stateDiagram/) !== null;\n};\n\nconst loader = async () => {\n  const { diagram } = await import('./stateDiagram');\n  return { id, diagram };\n};\n\nconst plugin: ExternalDiagramDefinition = {\n  id,\n  detector,\n  loader,\n};\n\nexport default plugin;\n","import type { DiagramDetector, ExternalDiagramDefinition } from '../../diagram-api/types';\n\nconst id = 'stateDiagram';\n\nconst detector: DiagramDetector = (text, config) => {\n  if (text.match(/^\\s*stateDiagram-v2/) !== null) {\n    return true;\n  }\n  if (text.match(/^\\s*stateDiagram/) && config?.state?.defaultRenderer === 'dagre-wrapper') {\n    return true;\n  }\n  if (text.match(/^\\s*stateDiagram/) && config?.state?.defaultRenderer === 'dagre-wrapper') {\n    return true;\n  }\n  return false;\n};\n\nconst loader = async () => {\n  const { diagram } = await import('./stateDiagram-v2');\n  return { id, diagram };\n};\n\nconst plugin: ExternalDiagramDefinition = {\n  id,\n  detector,\n  loader,\n};\n\nexport default plugin;\n","import type { DiagramDetector, ExternalDiagramDefinition } from '../../diagram-api/types';\n\nconst id = 'journey';\n\nconst detector: DiagramDetector = (txt) => {\n  return txt.match(/^\\s*journey/) !== null;\n};\n\nconst loader = async () => {\n  const { diagram } = await import('./journeyDiagram');\n  return { id, diagram };\n};\n\nconst plugin: ExternalDiagramDefinition = {\n  id,\n  detector,\n  loader,\n};\n\nexport default plugin;\n","import type { DiagramDetector, ExternalDiagramDefinition } from '../../diagram-api/types';\n\nconst id = 'error';\n\nconst detector: DiagramDetector = (text) => {\n  return text.toLowerCase().trim() === 'error';\n};\n\nconst loader = async () => {\n  const { diagram } = await import('./errorDiagram');\n  return { id, diagram };\n};\n\nconst plugin: ExternalDiagramDefinition = {\n  id,\n  detector,\n  loader,\n};\n\nexport default plugin;\n","import type { MermaidConfig } from '../../../config.type';\nimport type { ExternalDiagramDefinition, DiagramDetector } from '../../../diagram-api/types';\n\nconst id = 'flowchart-elk';\n\nconst detector: DiagramDetector = (txt: string, config?: MermaidConfig): boolean => {\n  if (\n    // If diagram explicitly states flowchart-elk\n    txt.match(/^\\s*flowchart-elk/) ||\n    // If a flowchart/graph diagram has their default renderer set to elk\n    (txt.match(/^\\s*flowchart|graph/) && config?.flowchart?.defaultRenderer === 'elk')\n  ) {\n    return true;\n  }\n  return false;\n};\n\nconst loader = async () => {\n  const { diagram } = await import('./flowchart-elk-definition.js');\n  return { id, diagram };\n};\n\nconst plugin: ExternalDiagramDefinition = {\n  id,\n  detector,\n  loader,\n};\n\nexport default plugin;\n","import type { ExternalDiagramDefinition } from '../../diagram-api/types';\n\nconst id = 'timeline';\n\nconst detector = (txt: string) => {\n  return txt.match(/^\\s*timeline/) !== null;\n};\n\nconst loader = async () => {\n  const { diagram } = await import('./timeline-definition.js');\n  return { id, diagram };\n};\n\nconst plugin: ExternalDiagramDefinition = {\n  id,\n  detector,\n  loader,\n};\n\nexport default plugin;\n","import type { ExternalDiagramDefinition } from '../../diagram-api/types';\nconst id = 'mindmap';\n\nconst detector = (txt: string) => {\n  return txt.match(/^\\s*mindmap/) !== null;\n};\n\nconst loader = async () => {\n  const { diagram } = await import('./mindmap-definition.js');\n  return { id, diagram };\n};\n\nconst plugin: ExternalDiagramDefinition = {\n  id,\n  detector,\n  loader,\n};\n\nexport default plugin;\n","import c4 from '../diagrams/c4/c4Detector';\nimport flowchart from '../diagrams/flowchart/flowDetector';\nimport flowchartV2 from '../diagrams/flowchart/flowDetector-v2';\nimport er from '../diagrams/er/erDetector';\nimport git from '../diagrams/git/gitGraphDetector';\nimport gantt from '../diagrams/gantt/ganttDetector';\nimport info from '../diagrams/info/infoDetector';\nimport pie from '../diagrams/pie/pieDetector';\nimport requirement from '../diagrams/requirement/requirementDetector';\nimport sequence from '../diagrams/sequence/sequenceDetector';\nimport classDiagram from '../diagrams/class/classDetector';\nimport classDiagramV2 from '../diagrams/class/classDetector-V2';\nimport state from '../diagrams/state/stateDetector';\nimport stateV2 from '../diagrams/state/stateDetector-V2';\nimport journey from '../diagrams/user-journey/journeyDetector';\nimport error from '../diagrams/error/errorDetector';\nimport flowchartElk from '../diagrams/flowchart/elk/detector';\nimport timeline from '../diagrams/timeline/detector';\nimport mindmap from '../diagrams/mindmap/detector';\nimport { registerLazyLoadedDiagrams } from './detectType';\nimport { registerDiagram } from './diagramAPI';\n\nlet hasLoadedDiagrams = false;\nexport const addDiagrams = () => {\n  if (hasLoadedDiagrams) {\n    return;\n  }\n  // This is added here to avoid race-conditions.\n  // We could optimize the loading logic somehow.\n  hasLoadedDiagrams = true;\n  registerDiagram(\n    '---',\n    // --- diagram type may appear if YAML front-matter is not parsed correctly\n    {\n      db: {\n        clear: () => {\n          // Quite ok, clear needs to be there for --- to work as a regular diagram\n        },\n      },\n      styles: {}, // should never be used\n      renderer: {}, // should never be used\n      parser: {\n        parser: { yy: {} },\n        parse: () => {\n          throw new Error(\n            'Diagrams beginning with --- are not valid. ' +\n              'If you were trying to use a YAML front-matter, please ensure that ' +\n              \"you've correctly opened and closed the YAML front-matter with un-indented `---` blocks\"\n          );\n        },\n      },\n      init: () => null, // no op\n    },\n    (text) => {\n      return text.toLowerCase().trimStart().startsWith('---');\n    }\n  );\n  // Ordering of detectors is important. The first one to return true will be used.\n  registerLazyLoadedDiagrams(\n    error,\n    c4,\n    classDiagramV2,\n    classDiagram,\n    er,\n    gantt,\n    info,\n    pie,\n    requirement,\n    sequence,\n    flowchartElk,\n    flowchartV2,\n    flowchart,\n    mindmap,\n    timeline,\n    git,\n    stateV2,\n    state,\n    journey\n  );\n};\n","import * as configApi from './config';\nimport { log } from './logger';\nimport { getDiagram, registerDiagram } from './diagram-api/diagramAPI';\nimport { detectType, getDiagramLoader } from './diagram-api/detectType';\nimport { extractFrontMatter } from './diagram-api/frontmatter';\nimport { UnknownDiagramError } from './errors';\nimport { DetailedError } from './utils';\n\nexport type ParseErrorFunction = (err: string | DetailedError | unknown, hash?: any) => void;\nexport class Diagram {\n  type = 'graph';\n  parser;\n  renderer;\n  db;\n  private detectError?: UnknownDiagramError;\n  constructor(public text: string) {\n    this.text += '\\n';\n    const cnf = configApi.getConfig();\n    try {\n      this.type = detectType(text, cnf);\n    } catch (e) {\n      this.type = 'error';\n      this.detectError = e as UnknownDiagramError;\n    }\n    const diagram = getDiagram(this.type);\n    log.debug('Type ' + this.type);\n    // Setup diagram\n    this.db = diagram.db;\n    this.db.clear?.();\n    this.renderer = diagram.renderer;\n    this.parser = diagram.parser;\n    const originalParse = this.parser.parse.bind(this.parser);\n    // Wrap the jison parse() method to handle extracting frontmatter.\n    //\n    // This can't be done in this.parse() because some code\n    // directly calls diagram.parser.parse(), bypassing this.parse().\n    //\n    // Similarly, we can't do this in getDiagramFromText() because some code\n    // calls diagram.db.clear(), which would reset anything set by\n    // extractFrontMatter().\n    this.parser.parse = (text: string) => originalParse(extractFrontMatter(text, this.db));\n    this.parser.parser.yy = this.db;\n    if (diagram.init) {\n      diagram.init(cnf);\n      log.info('Initialized diagram ' + this.type, cnf);\n    }\n    this.parse();\n  }\n\n  parse() {\n    if (this.detectError) {\n      throw this.detectError;\n    }\n    this.db.clear?.();\n    this.parser.parse(this.text);\n  }\n\n  async render(id: string, version: string) {\n    await this.renderer.draw(this.text, id, version, this);\n  }\n\n  getParser() {\n    return this.parser;\n  }\n\n  getType() {\n    return this.type;\n  }\n}\n\nexport const getDiagramFromText = async (text: string): Promise<Diagram> => {\n  const type = detectType(text, configApi.getConfig());\n  try {\n    // Trying to find the diagram\n    getDiagram(type);\n  } catch (error) {\n    const loader = getDiagramLoader(type);\n    if (!loader) {\n      throw new UnknownDiagramError(`Diagram ${type} not found.`);\n    }\n    // Diagram not available, loading it.\n    // new diagram will try getDiagram again and if fails then it is a valid throw\n    const { id, diagram } = await loader();\n    registerDiagram(id, diagram);\n  }\n  return new Diagram(text);\n};\n","let interactionFunctions: (() => void)[] = [];\nexport const addFunction = (func: () => void) => {\n  interactionFunctions.push(func);\n};\nexport const attachFunctions = () => {\n  interactionFunctions.forEach((f) => {\n    f();\n  });\n  interactionFunctions = [];\n};\n","/**\n * Accessibility (a11y) functions, types, helpers\n * @see https://www.w3.org/WAI/\n * @see https://www.w3.org/TR/wai-aria-1.1/\n * @see https://www.w3.org/TR/svg-aam-1.0/\n *\n */\nimport { D3Element } from './mermaidAPI';\n\nimport isEmpty from 'lodash-es/isEmpty.js';\n\n/**\n * SVG element role:\n * The SVG element role _should_ be set to 'graphics-document' per SVG standard\n * but in practice is not always done by browsers, etc. (As of 2022-12-08).\n * A fallback role of 'document' should be set for those browsers, etc., that only support ARIA 1.0.\n *\n * @see https://www.w3.org/TR/svg-aam-1.0/#roleMappingGeneralRules\n * @see https://www.w3.org/TR/graphics-aria-1.0/#graphics-document\n */\nconst SVG_ROLE = 'graphics-document document';\n\n/**\n * Add role and aria-roledescription to the svg element\n *\n * @param svg - d3 object that contains the SVG HTML element\n * @param diagramType - diagram name for to the aria-roledescription\n */\nexport function setA11yDiagramInfo(svg: D3Element, diagramType: string | null | undefined) {\n  svg.attr('role', SVG_ROLE);\n  if (!isEmpty(diagramType)) {\n    svg.attr('aria-roledescription', diagramType);\n  }\n}\n/**\n * Add an accessible title and/or description element to a chart.\n * The title is usually not displayed and the description is never displayed.\n *\n * The following charts display their title as a visual and accessibility element: gantt\n *\n * @param svg - d3 node to insert the a11y title and desc info\n * @param a11yTitle - a11y title. null and undefined are meaningful: means to skip it\n * @param a11yDesc - a11y description.  null and undefined are meaningful: means to skip it\n * @param baseId - id used to construct the a11y title and description id\n */\nexport function addSVGa11yTitleDescription(\n  svg: D3Element,\n  a11yTitle: string | null | undefined,\n  a11yDesc: string | null | undefined,\n  baseId: string\n) {\n  if (svg.insert === undefined) {\n    return;\n  }\n\n  if (a11yTitle || a11yDesc) {\n    if (a11yDesc) {\n      const descId = 'chart-desc-' + baseId;\n      svg.attr('aria-describedby', descId);\n      svg.insert('desc', ':first-child').attr('id', descId).text(a11yDesc);\n    }\n    if (a11yTitle) {\n      const titleId = 'chart-title-' + baseId;\n      svg.attr('aria-labelledby', titleId);\n      svg.insert('title', ':first-child').attr('id', titleId).text(a11yTitle);\n    }\n  } else {\n    return;\n  }\n}\n","/**\n * This is the API to be used when optionally handling the integration with the web page, instead of\n * using the default integration provided by mermaid.js.\n *\n * The core of this api is the [**render**](Setup.md?id=render) function which, given a graph\n * definition as text, renders the graph/diagram and returns an svg element for the graph.\n *\n * It is then up to the user of the API to make use of the svg, either insert it somewhere in the\n * page or do something completely different.\n *\n * In addition to the render function, a number of behavioral configuration options are available.\n */\n// @ts-ignore TODO: Investigate D3 issue\nimport { select } from 'd3';\nimport { compile, serialize, stringify } from 'stylis';\n// @ts-ignore: TODO Fix ts errors\nimport { version } from '../package.json';\nimport * as configApi from './config';\nimport { addDiagrams } from './diagram-api/diagram-orchestration';\nimport { Diagram, getDiagramFromText } from './Diagram';\nimport errorRenderer from './diagrams/error/errorRenderer';\nimport { attachFunctions } from './interactionDb';\nimport { log, setLogLevel } from './logger';\nimport getStyles from './styles';\nimport theme from './themes';\nimport utils, { directiveSanitizer } from './utils';\nimport DOMPurify from 'dompurify';\nimport { MermaidConfig } from './config.type';\nimport { evaluate } from './diagrams/common/common';\nimport isEmpty from 'lodash-es/isEmpty.js';\nimport { setA11yDiagramInfo, addSVGa11yTitleDescription } from './accessibility';\nimport { parseDirective } from './directiveUtils';\n\n// diagram names that support classDef statements\nconst CLASSDEF_DIAGRAMS = ['graph', 'flowchart', 'flowchart-v2', 'stateDiagram', 'stateDiagram-v2'];\nconst MAX_TEXTLENGTH = 50_000;\nconst MAX_TEXTLENGTH_EXCEEDED_MSG =\n  'graph TB;a[Maximum text size in diagram exceeded];style a fill:#faa';\n\nconst SECURITY_LVL_SANDBOX = 'sandbox';\nconst SECURITY_LVL_LOOSE = 'loose';\n\nconst XMLNS_SVG_STD = 'http://www.w3.org/2000/svg';\nconst XMLNS_XLINK_STD = 'http://www.w3.org/1999/xlink';\nconst XMLNS_XHTML_STD = 'http://www.w3.org/1999/xhtml';\n\n// ------------------------------\n// iFrame\nconst IFRAME_WIDTH = '100%';\nconst IFRAME_HEIGHT = '100%';\nconst IFRAME_STYLES = 'border:0;margin:0;';\nconst IFRAME_BODY_STYLE = 'margin:0';\nconst IFRAME_SANDBOX_OPTS = 'allow-top-navigation-by-user-activation allow-popups';\nconst IFRAME_NOT_SUPPORTED_MSG = 'The \"iframe\" tag is not supported by your browser.';\n\n// DOMPurify settings for svgCode\nconst DOMPURIFY_TAGS = ['foreignobject'];\nconst DOMPURIFY_ATTR = ['dominant-baseline'];\n\n// This is what is returned from getClasses(...) methods.\n// It is slightly renamed to ..StyleClassDef instead of just ClassDef because \"class\" is a greatly ambiguous and overloaded word.\n// It makes it clear we're working with a style class definition, even though defining the type is currently difficult.\ninterface DiagramStyleClassDef {\n  id: string;\n  styles?: string[];\n  textStyles?: string[];\n}\n\nexport interface ParseOptions {\n  suppressErrors?: boolean;\n}\n\n// This makes it clear that we're working with a d3 selected element of some kind, even though it's hard to specify the exact type.\n// @ts-ignore Could replicate the type definition in d3. This also makes it possible to use the untyped info from the js diagram files.\nexport type D3Element = any;\n\nexport interface RenderResult {\n  /**\n   * The svg code for the rendered graph.\n   */\n  svg: string;\n  /**\n   * Bind function to be called after the svg has been inserted into the DOM.\n   * This is necessary for adding event listeners to the elements in the svg.\n   * ```js\n   * const { svg, bindFunctions } = mermaidAPI.render('id1', 'graph TD;A-->B');\n   * div.innerHTML = svg;\n   * bindFunctions?.(div); // To call bindFunctions only if it's present.\n   * ```\n   */\n  bindFunctions?: (element: Element) => void;\n}\n\n/**\n * Parse the text and validate the syntax.\n * @param text - The mermaid diagram definition.\n * @param parseOptions - Options for parsing.\n * @returns true if the diagram is valid, false otherwise if parseOptions.suppressErrors is true.\n * @throws Error if the diagram is invalid and parseOptions.suppressErrors is false.\n */\n\nasync function parse(text: string, parseOptions?: ParseOptions): Promise<boolean | void> {\n  addDiagrams();\n  let error;\n  try {\n    const diagram = await getDiagramFromText(text);\n    diagram.parse();\n  } catch (err) {\n    error = err;\n  }\n  if (parseOptions?.suppressErrors) {\n    return error === undefined;\n  }\n  if (error) {\n    throw error;\n  }\n}\n\n/**\n * @param  text - text to be encoded\n * @returns\n */\nexport const encodeEntities = function (text: string): string {\n  let txt = text;\n\n  txt = txt.replace(/style.*:\\S*#.*;/g, function (s): string {\n    return s.substring(0, s.length - 1);\n  });\n  txt = txt.replace(/classDef.*:\\S*#.*;/g, function (s): string {\n    return s.substring(0, s.length - 1);\n  });\n\n  txt = txt.replace(/#\\w+;/g, function (s) {\n    const innerTxt = s.substring(1, s.length - 1);\n\n    const isInt = /^\\+?\\d+$/.test(innerTxt);\n    if (isInt) {\n      return 'fl°°' + innerTxt + '¶ß';\n    } else {\n      return 'fl°' + innerTxt + '¶ß';\n    }\n  });\n\n  return txt;\n};\n\n/**\n *\n * @param  text - text to be decoded\n * @returns\n */\nexport const decodeEntities = function (text: string): string {\n  let txt = text;\n\n  txt = txt.replace(/fl°°/g, '&#');\n  txt = txt.replace(/fl°/g, '&');\n  txt = txt.replace(/¶ß/g, ';');\n\n  return txt;\n};\n\n// append !important; to each cssClass followed by a final !important, all enclosed in { }\n//\n/**\n * Create a CSS style that starts with the given class name, then the element,\n * with an enclosing block that has each of the cssClasses followed by !important;\n * @param cssClass - CSS class name\n * @param element - CSS element\n * @param cssClasses - list of CSS styles to append after the element\n * @returns - the constructed string\n */\nexport const cssImportantStyles = (\n  cssClass: string,\n  element: string,\n  cssClasses: string[] = []\n): string => {\n  return `\\n.${cssClass} ${element} { ${cssClasses.join(' !important; ')} !important; }`;\n};\n\n/**\n * Create the user styles\n *\n * @param  config - configuration that has style and theme settings to use\n * @param graphType - used for checking if classDefs should be applied\n * @param  classDefs - the classDefs in the diagram text. Might be null if none were defined. Usually is the result of a call to getClasses(...)\n * @returns  the string with all the user styles\n */\nexport const createCssStyles = (\n  config: MermaidConfig,\n  graphType: string,\n  classDefs: Record<string, DiagramStyleClassDef> | null | undefined = {}\n): string => {\n  let cssStyles = '';\n\n  // user provided theme CSS info\n  // If you add more configuration driven data into the user styles make sure that the value is\n  // sanitized by the sanitize CSS function TODO where is this method?  what should be used to replace it?  refactor so that it's always sanitized\n  if (config.themeCSS !== undefined) {\n    cssStyles += `\\n${config.themeCSS}`;\n  }\n\n  if (config.fontFamily !== undefined) {\n    cssStyles += `\\n:root { --mermaid-font-family: ${config.fontFamily}}`;\n  }\n  if (config.altFontFamily !== undefined) {\n    cssStyles += `\\n:root { --mermaid-alt-font-family: ${config.altFontFamily}}`;\n  }\n\n  // classDefs defined in the diagram text\n  if (!isEmpty(classDefs) && CLASSDEF_DIAGRAMS.includes(graphType)) {\n    const htmlLabels = config.htmlLabels || config.flowchart?.htmlLabels; // TODO why specifically check the Flowchart diagram config?\n\n    const cssHtmlElements = ['> *', 'span']; // TODO make a constant\n    const cssShapeElements = ['rect', 'polygon', 'ellipse', 'circle', 'path']; // TODO make a constant\n\n    const cssElements = htmlLabels ? cssHtmlElements : cssShapeElements;\n\n    // create the CSS styles needed for each styleClass definition and css element\n    for (const classId in classDefs) {\n      const styleClassDef = classDefs[classId];\n      // create the css styles for each cssElement and the styles (only if there are styles)\n      if (!isEmpty(styleClassDef.styles)) {\n        cssElements.forEach((cssElement) => {\n          cssStyles += cssImportantStyles(styleClassDef.id, cssElement, styleClassDef.styles);\n        });\n      }\n      // create the css styles for the tspan element and the text styles (only if there are textStyles)\n      if (!isEmpty(styleClassDef.textStyles)) {\n        cssStyles += cssImportantStyles(styleClassDef.id, 'tspan', styleClassDef.textStyles);\n      }\n    }\n  }\n  return cssStyles;\n};\n\nexport const createUserStyles = (\n  config: MermaidConfig,\n  graphType: string,\n  classDefs: Record<string, DiagramStyleClassDef>,\n  svgId: string\n): string => {\n  const userCSSstyles = createCssStyles(config, graphType, classDefs);\n  const allStyles = getStyles(graphType, userCSSstyles, config.themeVariables);\n\n  // Now turn all of the styles into a (compiled) string that starts with the id\n  // use the stylis library to compile the css, turn the results into a valid CSS string (serialize(...., stringify))\n  // @see https://github.com/thysultan/stylis\n  return serialize(compile(`${svgId}{${allStyles}}`), stringify);\n};\n\n/**\n * Clean up svgCode. Do replacements needed\n *\n * @param svgCode - the code to clean up\n * @param inSandboxMode - security level\n * @param useArrowMarkerUrls - should arrow marker's use full urls? (vs. just the anchors)\n * @returns the cleaned up svgCode\n */\nexport const cleanUpSvgCode = (\n  svgCode = '',\n  inSandboxMode: boolean,\n  useArrowMarkerUrls: boolean\n): string => {\n  let cleanedUpSvg = svgCode;\n\n  // Replace marker-end urls with just the # anchor (remove the preceding part of the URL)\n  if (!useArrowMarkerUrls && !inSandboxMode) {\n    cleanedUpSvg = cleanedUpSvg.replace(/marker-end=\"url\\(.*?#/g, 'marker-end=\"url(#');\n  }\n\n  cleanedUpSvg = decodeEntities(cleanedUpSvg);\n\n  // replace old br tags with newer style\n  cleanedUpSvg = cleanedUpSvg.replace(/<br>/g, '<br/>');\n\n  return cleanedUpSvg;\n};\n\n/**\n * Put the svgCode into an iFrame. Return the iFrame code\n *\n * @param svgCode - the svg code to put inside the iFrame\n * @param svgElement - the d3 node that has the current svgElement so we can get the height from it\n * @returns  - the code with the iFrame that now contains the svgCode\n * TODO replace btoa(). Replace with  buf.toString('base64')?\n */\nexport const putIntoIFrame = (svgCode = '', svgElement?: D3Element): string => {\n  const height = svgElement ? svgElement.viewBox.baseVal.height + 'px' : IFRAME_HEIGHT;\n  const base64encodedSrc = btoa('<body style=\"' + IFRAME_BODY_STYLE + '\">' + svgCode + '</body>');\n  return `<iframe style=\"width:${IFRAME_WIDTH};height:${height};${IFRAME_STYLES}\" src=\"data:text/html;base64,${base64encodedSrc}\" sandbox=\"${IFRAME_SANDBOX_OPTS}\">\n  ${IFRAME_NOT_SUPPORTED_MSG}\n</iframe>`;\n};\n\n/**\n * Append an enclosing div, then svg, then g (group) to the d3 parentRoot. Set attributes.\n * Only set the style attribute on the enclosing div if divStyle is given.\n * Only set the xmlns:xlink attribute on svg if svgXlink is given.\n * Return the last node appended\n *\n * @param parentRoot - the d3 node to append things to\n * @param id - the value to set the id attr to\n * @param enclosingDivId - the id to set the enclosing div to\n * @param divStyle - if given, the style to set the enclosing div to\n * @param svgXlink - if given, the link to set the new svg element to\n * @returns - returns the parentRoot that had nodes appended\n */\nexport const appendDivSvgG = (\n  parentRoot: D3Element,\n  id: string,\n  enclosingDivId: string,\n  divStyle?: string,\n  svgXlink?: string\n): D3Element => {\n  const enclosingDiv = parentRoot.append('div');\n  enclosingDiv.attr('id', enclosingDivId);\n  if (divStyle) {\n    enclosingDiv.attr('style', divStyle);\n  }\n\n  const svgNode = enclosingDiv\n    .append('svg')\n    .attr('id', id)\n    .attr('width', '100%')\n    .attr('xmlns', XMLNS_SVG_STD);\n  if (svgXlink) {\n    svgNode.attr('xmlns:xlink', svgXlink);\n  }\n\n  svgNode.append('g');\n  return parentRoot;\n};\n\n/**\n * Append an iFrame node to the given parentNode and set the id, style, and 'sandbox' attributes\n *  Return the appended iframe d3 node\n *\n * @param parentNode - the d3 node to append the iFrame node to\n * @param iFrameId - id to use for the iFrame\n * @returns the appended iframe d3 node\n */\nfunction sandboxedIframe(parentNode: D3Element, iFrameId: string): D3Element {\n  return parentNode\n    .append('iframe')\n    .attr('id', iFrameId)\n    .attr('style', 'width: 100%; height: 100%;')\n    .attr('sandbox', '');\n}\n\n/**\n * Remove any existing elements from the given document\n *\n * @param doc - the document to removed elements from\n * @param id - id for any existing SVG element\n * @param divSelector - selector for any existing enclosing div element\n * @param iFrameSelector - selector for any existing iFrame element\n */\nexport const removeExistingElements = (\n  doc: Document,\n  id: string,\n  divId: string,\n  iFrameId: string\n) => {\n  // Remove existing SVG element if it exists\n  doc.getElementById(id)?.remove();\n  // Remove previous temporary element if it exists\n  // Both div and iframe needs to be cleared in case there is a config change happening between renders.\n  doc.getElementById(divId)?.remove();\n  doc.getElementById(iFrameId)?.remove();\n};\n\n/**\n * @deprecated - use the `mermaid.render` function instead of `mermaid.mermaidAPI.render`\n *\n * Deprecated for external use.\n */\n\nconst render = async function (\n  id: string,\n  text: string,\n  svgContainingElement?: Element\n): Promise<RenderResult> {\n  addDiagrams();\n\n  configApi.reset();\n\n  // Add Directives. Must do this before getting the config and before creating the diagram.\n  const graphInit = utils.detectInit(text);\n  if (graphInit) {\n    directiveSanitizer(graphInit);\n    configApi.addDirective(graphInit);\n  }\n\n  const config = configApi.getConfig();\n  log.debug(config);\n\n  // Check the maximum allowed text size\n  if (text.length > (config?.maxTextSize ?? MAX_TEXTLENGTH)) {\n    text = MAX_TEXTLENGTH_EXCEEDED_MSG;\n  }\n\n  // clean up text CRLFs\n  text = text.replace(/\\r\\n?/g, '\\n'); // parser problems on CRLF ignore all CR and leave LF;;\n\n  const idSelector = '#' + id;\n  const iFrameID = 'i' + id;\n  const iFrameID_selector = '#' + iFrameID;\n  const enclosingDivID = 'd' + id;\n  const enclosingDivID_selector = '#' + enclosingDivID;\n\n  let root: any = select('body');\n\n  const isSandboxed = config.securityLevel === SECURITY_LVL_SANDBOX;\n  const isLooseSecurityLevel = config.securityLevel === SECURITY_LVL_LOOSE;\n\n  const fontFamily = config.fontFamily;\n\n  // -------------------------------------------------------------------------------\n  // Define the root d3 node\n  // In regular execution the svgContainingElement will be the element with a mermaid class\n\n  if (svgContainingElement !== undefined) {\n    if (svgContainingElement) {\n      svgContainingElement.innerHTML = '';\n    }\n\n    if (isSandboxed) {\n      // If we are in sandboxed mode, we do everything mermaid related in a (sandboxed )iFrame\n      const iframe = sandboxedIframe(select(svgContainingElement), iFrameID);\n      root = select(iframe.nodes()[0]!.contentDocument!.body);\n      root.node().style.margin = 0;\n    } else {\n      root = select(svgContainingElement);\n    }\n    appendDivSvgG(root, id, enclosingDivID, `font-family: ${fontFamily}`, XMLNS_XLINK_STD);\n  } else {\n    // No svgContainingElement was provided\n\n    // If there is an existing element with the id, we remove it. This likely a previously rendered diagram\n    removeExistingElements(document, id, enclosingDivID, iFrameID);\n\n    // Add the temporary div used for rendering with the enclosingDivID.\n    // This temporary div will contain a svg with the id == id\n\n    if (isSandboxed) {\n      // If we are in sandboxed mode, we do everything mermaid related in a (sandboxed) iFrame\n      const iframe = sandboxedIframe(select('body'), iFrameID);\n      root = select(iframe.nodes()[0]!.contentDocument!.body);\n      root.node().style.margin = 0;\n    } else {\n      root = select('body');\n    }\n\n    appendDivSvgG(root, id, enclosingDivID);\n  }\n\n  text = encodeEntities(text);\n\n  // -------------------------------------------------------------------------------\n  // Create the diagram\n\n  // Important that we do not create the diagram until after the directives have been included\n  let diag: Diagram;\n  let parseEncounteredException;\n\n  try {\n    diag = await getDiagramFromText(text);\n  } catch (error) {\n    diag = new Diagram('error');\n    parseEncounteredException = error;\n  }\n\n  // Get the temporary div element containing the svg\n  const element = root.select(enclosingDivID_selector).node();\n  const graphType = diag.type;\n\n  // -------------------------------------------------------------------------------\n  // Create and insert the styles (user styles, theme styles, config styles)\n\n  // Insert an element into svg. This is where we put the styles\n  const svg = element.firstChild;\n  const firstChild = svg.firstChild;\n  const diagramClassDefs = CLASSDEF_DIAGRAMS.includes(graphType)\n    ? diag.renderer.getClasses(text, diag)\n    : {};\n\n  const rules = createUserStyles(\n    config,\n    graphType,\n    // @ts-ignore convert renderer to TS.\n    diagramClassDefs,\n    idSelector\n  );\n\n  const style1 = document.createElement('style');\n  style1.innerHTML = rules;\n  svg.insertBefore(style1, firstChild);\n\n  // -------------------------------------------------------------------------------\n  // Draw the diagram with the renderer\n  try {\n    await diag.renderer.draw(text, id, version, diag);\n  } catch (e) {\n    errorRenderer.draw(text, id, version);\n    throw e;\n  }\n\n  // This is the d3 node for the svg element\n  const svgNode = root.select(`${enclosingDivID_selector} svg`);\n  const a11yTitle = diag.db.getAccTitle?.();\n  const a11yDescr = diag.db.getAccDescription?.();\n  addA11yInfo(graphType, svgNode, a11yTitle, a11yDescr);\n\n  // -------------------------------------------------------------------------------\n  // Clean up SVG code\n  root.select(`[id=\"${id}\"]`).selectAll('foreignobject > *').attr('xmlns', XMLNS_XHTML_STD);\n\n  // Fix for when the base tag is used\n  let svgCode: string = root.select(enclosingDivID_selector).node().innerHTML;\n\n  log.debug('config.arrowMarkerAbsolute', config.arrowMarkerAbsolute);\n  svgCode = cleanUpSvgCode(svgCode, isSandboxed, evaluate(config.arrowMarkerAbsolute));\n\n  if (isSandboxed) {\n    const svgEl = root.select(enclosingDivID_selector + ' svg').node();\n    svgCode = putIntoIFrame(svgCode, svgEl);\n  } else if (!isLooseSecurityLevel) {\n    // Sanitize the svgCode using DOMPurify\n    svgCode = DOMPurify.sanitize(svgCode, {\n      ADD_TAGS: DOMPURIFY_TAGS,\n      ADD_ATTR: DOMPURIFY_ATTR,\n    });\n  }\n\n  attachFunctions();\n\n  // -------------------------------------------------------------------------------\n  // Remove the temporary HTML element if appropriate\n  const tmpElementSelector = isSandboxed ? iFrameID_selector : enclosingDivID_selector;\n  const node = select(tmpElementSelector).node();\n  if (node && 'remove' in node) {\n    node.remove();\n  }\n\n  if (parseEncounteredException) {\n    throw parseEncounteredException;\n  }\n\n  return {\n    svg: svgCode,\n    bindFunctions: diag.db.bindFunctions,\n  };\n};\n\n/**\n * @param  options - Initial Mermaid options\n */\nfunction initialize(options: MermaidConfig = {}) {\n  // Handle legacy location of font-family configuration\n  if (options?.fontFamily && !options.themeVariables?.fontFamily) {\n    if (!options.themeVariables) {\n      options.themeVariables = {};\n    }\n    options.themeVariables.fontFamily = options.fontFamily;\n  }\n\n  // Set default options\n  configApi.saveConfigFromInitialize(options);\n\n  if (options?.theme && options.theme in theme) {\n    // Todo merge with user options\n    options.themeVariables = theme[options.theme as keyof typeof theme].getThemeVariables(\n      options.themeVariables\n    );\n  } else if (options) {\n    options.themeVariables = theme.default.getThemeVariables(options.themeVariables);\n  }\n\n  const config =\n    typeof options === 'object' ? configApi.setSiteConfig(options) : configApi.getSiteConfig();\n\n  setLogLevel(config.logLevel);\n  addDiagrams();\n}\n\n/**\n * Add accessibility (a11y) information to the diagram.\n *\n */\nfunction addA11yInfo(\n  graphType: string,\n  svgNode: D3Element,\n  a11yTitle: string | undefined,\n  a11yDescr: string | undefined\n) {\n  setA11yDiagramInfo(svgNode, graphType);\n  addSVGa11yTitleDescription(svgNode, a11yTitle, a11yDescr, svgNode.attr('id'));\n}\n\n/**\n * ## mermaidAPI configuration defaults\n *\n * ```ts\n *   const config = {\n *     theme: 'default',\n *     logLevel: 'fatal',\n *     securityLevel: 'strict',\n *     startOnLoad: true,\n *     arrowMarkerAbsolute: false,\n *\n *     er: {\n *       diagramPadding: 20,\n *       layoutDirection: 'TB',\n *       minEntityWidth: 100,\n *       minEntityHeight: 75,\n *       entityPadding: 15,\n *       stroke: 'gray',\n *       fill: 'honeydew',\n *       fontSize: 12,\n *       useMaxWidth: true,\n *     },\n *     flowchart: {\n *       diagramPadding: 8,\n *       htmlLabels: true,\n *       curve: 'basis',\n *     },\n *     sequence: {\n *       diagramMarginX: 50,\n *       diagramMarginY: 10,\n *       actorMargin: 50,\n *       width: 150,\n *       height: 65,\n *       boxMargin: 10,\n *       boxTextMargin: 5,\n *       noteMargin: 10,\n *       messageMargin: 35,\n *       messageAlign: 'center',\n *       mirrorActors: true,\n *       bottomMarginAdj: 1,\n *       useMaxWidth: true,\n *       rightAngles: false,\n *       showSequenceNumbers: false,\n *     },\n *     gantt: {\n *       titleTopMargin: 25,\n *       barHeight: 20,\n *       barGap: 4,\n *       topPadding: 50,\n *       leftPadding: 75,\n *       gridLineStartPadding: 35,\n *       fontSize: 11,\n *       fontFamily: '\"Open Sans\", sans-serif',\n *       numberSectionStyles: 4,\n *       axisFormat: '%Y-%m-%d',\n *       topAxis: false,\n *     },\n *   };\n *   mermaid.initialize(config);\n * ```\n */\n\nexport const mermaidAPI = Object.freeze({\n  render,\n  parse,\n  parseDirective,\n  initialize,\n  getConfig: configApi.getConfig,\n  setConfig: configApi.setConfig,\n  getSiteConfig: configApi.getSiteConfig,\n  updateSiteConfig: configApi.updateSiteConfig,\n  reset: () => {\n    configApi.reset();\n  },\n  globalReset: () => {\n    configApi.reset(configApi.defaultConfig);\n  },\n  defaultConfig: configApi.defaultConfig,\n});\n\nsetLogLevel(configApi.getConfig().logLevel);\nconfigApi.reset(configApi.getConfig());\nexport default mermaidAPI;\n"],"names":["id","detector","loader","plugin","configApi.getConfig","text","version","error","configApi.reset","configApi.addDirective","errorRenderer","configApi.saveConfigFromInitialize","configApi.setSiteConfig","configApi.getSiteConfig","configApi.defaultConfig"],"mappings":";;;;;;;;AAEA,MAAMA,OAAK;AAEX,MAAMC,aAAW,CAAC,QAAgB;AACzB,SAAA,IAAI,MAAM,8DAA8D,MAAM;A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