You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
 
 

1 lines
110 KiB

{"version":3,"file":"ngx-markdown.mjs","sources":["../../../lib/src/clipboard-button.component.ts","../../../lib/src/clipboard-options.ts","../../../lib/src/katex-options.ts","../../../lib/src/language.pipe.ts","../../../lib/src/marked-extensions.ts","../../../lib/src/marked-options.ts","../../../lib/src/mermaid-options.ts","../../../lib/src/sanitize-options.ts","../../../lib/src/markdown.service.ts","../../../lib/src/prism-plugin.ts","../../../lib/src/markdown.component.ts","../../../lib/src/markdown.pipe.ts","../../../lib/src/provide-markdown.ts","../../../lib/src/markdown.module.ts","../../../lib/ngx-markdown.ts"],"sourcesContent":["import { ChangeDetectionStrategy, Component, computed } from '@angular/core';\r\nimport { toSignal } from '@angular/core/rxjs-interop';\r\nimport { merge, of, Subject, timer } from 'rxjs';\r\nimport { distinctUntilChanged, mapTo, shareReplay, switchMap } from 'rxjs/operators';\r\n\r\nconst BUTTON_TEXT_COPY = 'Copy';\r\nconst BUTTON_TEXT_COPIED = 'Copied';\r\n\r\n@Component({\r\n selector: 'markdown-clipboard',\r\n template: `\r\n <button\r\n class=\"markdown-clipboard-button\"\r\n [class.copied]=\"copied()\"\r\n (click)=\"onCopyToClipboardClick()\"\r\n >{{ copiedText() }}</button>\r\n `,\r\n changeDetection: ChangeDetectionStrategy.OnPush,\r\n})\r\nexport class ClipboardButtonComponent {\r\n private _buttonClick$ = new Subject<void>();\r\n\r\n readonly copied = toSignal(\r\n this._buttonClick$.pipe(\r\n switchMap(() => merge(\r\n of(true),\r\n timer(3000).pipe(mapTo(false)),\r\n )),\r\n distinctUntilChanged(),\r\n shareReplay(1),\r\n )\r\n );\r\n\r\n readonly copiedText = computed(() =>\r\n this.copied()\r\n ? BUTTON_TEXT_COPIED\r\n : BUTTON_TEXT_COPY\r\n );\r\n\r\n onCopyToClipboardClick(): void {\r\n this._buttonClick$.next();\r\n }\r\n}\r\n","import { InjectionToken, TemplateRef, Type } from '@angular/core';\r\n\r\nexport interface ClipboardOptions {\r\n buttonComponent?: Type<unknown>;\r\n}\r\n\r\nexport interface ClipboardRenderOptions extends ClipboardOptions {\r\n buttonTemplate?: TemplateRef<unknown>;\r\n}\r\n\r\nexport const CLIPBOARD_OPTIONS = new InjectionToken<ClipboardOptions>('CLIPBOARD_OPTIONS');\r\n","/* eslint-disable */\r\nexport class KatexSpecificOptions {\r\n /**\r\n * If `true`, math will be rendered in display mode\r\n * (math in display style and center math on page)\r\n *\r\n * If `false`, math will be rendered in inline mode\r\n * @default false\r\n */\r\n displayMode?: boolean;\r\n /**\r\n * If `true`, KaTeX will throw a `ParseError` when\r\n * it encounters an unsupported command or invalid LaTex\r\n *\r\n * If `false`, KaTeX will render unsupported commands as\r\n * text, and render invalid LaTeX as its source code with\r\n * hover text giving the error, in color given by errorColor\r\n * @default true\r\n */\r\n throwOnError?: boolean;\r\n /**\r\n * A Color string given in format `#XXX` or `#XXXXXX`\r\n */\r\n errorColor?: string;\r\n /**\r\n * A collection of custom macros.\r\n *\r\n * See `src/macros.js` for its usage\r\n */\r\n macros?: any;\r\n /**\r\n * If `true`, `\\color` will work like LaTeX's `\\textcolor`\r\n * and takes 2 arguments\r\n *\r\n * If `false`, `\\color` will work like LaTeX's `\\color`\r\n * and takes 1 argument\r\n *\r\n * In both cases, `\\textcolor` works as in LaTeX\r\n *\r\n * @default false\r\n */\r\n colorIsTextColor?: boolean;\r\n /**\r\n * All user-specified sizes will be caped to `maxSize` ems\r\n *\r\n * If set to Infinity, users can make elements and space\r\n * arbitrarily large\r\n *\r\n * @default Infinity\r\n */\r\n maxSize?: number;\r\n /**\r\n * Limit the number of macro expansions to specified number\r\n *\r\n * If set to `Infinity`, marco expander will try to fully expand\r\n * as in LaTex\r\n *\r\n * @default 1000\r\n */\r\n maxExpand?: number;\r\n /**\r\n * Allowed protocols in `\\href`\r\n *\r\n * Use `_relative` to allow relative urls\r\n *\r\n * Use `*` to allow all protocols\r\n */\r\n allowedProtocols?: string[];\r\n /**\r\n * If `false` or `\"ignore\"`, allow features that make\r\n * writing in LaTex convenient but not supported by LaTex\r\n *\r\n * If `true` or `\"error\"`, throw an error for such transgressions\r\n *\r\n * If `\"warn\"`, warn about behavior via `console.warn`\r\n *\r\n * @default \"warn\"\r\n */\r\n strict?: boolean | string | Function;\r\n}\r\n\r\nexport interface RenderMathInElementSpecificOptionsDelimiters {\r\n /**\r\n * A string which starts the math expression (i.e. the left delimiter)\r\n */\r\n left: string;\r\n /**\r\n * A string which ends the math expression (i.e. the right delimiter)\r\n */\r\n right: string;\r\n /**\r\n * A boolean of whether the math in the expression should be rendered in display mode or not\r\n */\r\n display: boolean\r\n}\r\n\r\nexport interface RenderMathInElementSpecificOptions {\r\n /**\r\n * A list of delimiters to look for math\r\n *\r\n * @default [\r\n * {left: \"$$\", right: \"$$\", display: true},\r\n * {left: \"\\\\(\", right: \"\\\\)\", display: false},\r\n * {left: \"\\\\[\", right: \"\\\\]\", display: true}\r\n * ]\r\n */\r\n delimiters?: ReadonlyArray<RenderMathInElementSpecificOptionsDelimiters> | undefined;\r\n /**\r\n * A list of DOM node types to ignore when recursing through\r\n *\r\n * @default [\"script\", \"noscript\", \"style\", \"textarea\", \"pre\", \"code\"]\r\n */\r\n ignoredTags?: ReadonlyArray<keyof HTMLElementTagNameMap> | undefined;\r\n /**\r\n * A list of DOM node class names to ignore when recursing through\r\n *\r\n * @default []\r\n */\r\n ignoredClasses?: string[] | undefined;\r\n\r\n /**\r\n * A callback method returning a message and an error stack in case of an critical error during rendering\r\n * @param msg Message generated by KaTeX\r\n * @param err Caught error\r\n *\r\n * @default console.error\r\n */\r\n errorCallback?(msg: string, err: Error): void;\r\n}\r\n\r\n/**\r\n * renderMathInElement options contain KaTeX render options and renderMathInElement specific options\r\n */\r\nexport type KatexOptions = KatexSpecificOptions & RenderMathInElementSpecificOptions;\r\n","import { Pipe, PipeTransform } from '@angular/core';\r\n\r\n@Pipe({\r\n name: 'language',\r\n})\r\nexport class LanguagePipe implements PipeTransform {\r\n\r\n transform(value: string | null, language: string): string {\r\n if (value == null) {\r\n value = '';\r\n }\r\n if (language == null) {\r\n language = '';\r\n }\r\n if (typeof value !== 'string') {\r\n console.error(`LanguagePipe has been invoked with an invalid value type [${typeof value}]`);\r\n return value;\r\n }\r\n if (typeof language !== 'string') {\r\n console.error(`LanguagePipe has been invoked with an invalid parameter [${typeof language}]`);\r\n return value;\r\n }\r\n return '```' + language + '\\n' + value + '\\n```';\r\n }\r\n}\r\n","import { InjectionToken } from '@angular/core';\r\nimport { MarkedExtension } from 'marked';\r\n\r\nexport const MARKED_EXTENSIONS = new InjectionToken<MarkedExtension>('MARKED_EXTENSIONS');\r\n","import { InjectionToken } from '@angular/core';\r\nimport { MarkedOptions } from 'marked';\r\n\r\nexport type { MarkedOptions } from 'marked';\r\n\r\nexport const MARKED_OPTIONS = new InjectionToken<MarkedOptions>('MARKED_OPTIONS');\r\n","import { InjectionToken } from '@angular/core';\r\n\r\nexport const MERMAID_OPTIONS = new InjectionToken<MermaidAPI.MermaidConfig>('MERMAID_OPTIONS');\r\n\r\n/* eslint-disable */\r\nexport namespace MermaidAPI {\r\n /**\r\n * JavaScript function that returns a `FontConfig`.\r\n *\r\n * By default, these return the appropriate `*FontSize`, `*FontFamily`, `*FontWeight`\r\n * values.\r\n *\r\n * For example, the font calculator called `boundaryFont` might be defined as:\r\n *\r\n * ```javascript\r\n * boundaryFont: function () {\r\n * return {\r\n * fontFamily: this.boundaryFontFamily,\r\n * fontSize: this.boundaryFontSize,\r\n * fontWeight: this.boundaryFontWeight,\r\n * };\r\n * }\r\n * ```\r\n *\r\n *\r\n * This interface was referenced by `MermaidConfig`'s JSON-Schema\r\n * via the `definition` \"FontCalculator\".\r\n */\r\n export type FontCalculator = () => Partial<FontConfig>;\r\n /**\r\n * Picks the color of the sankey diagram links, using the colors of the source and/or target of the links.\r\n *\r\n *\r\n * This interface was referenced by `MermaidConfig`'s JSON-Schema\r\n * via the `definition` \"SankeyLinkColor\".\r\n */\r\n export type SankeyLinkColor = 'source' | 'target' | 'gradient';\r\n /**\r\n * Controls the alignment of the Sankey diagrams.\r\n *\r\n * See <https://github.com/d3/d3-sankey#alignments>.\r\n *\r\n *\r\n * This interface was referenced by `MermaidConfig`'s JSON-Schema\r\n * via the `definition` \"SankeyNodeAlignment\".\r\n */\r\n export type SankeyNodeAlignment = 'left' | 'right' | 'center' | 'justify';\r\n /**\r\n * The font size to use\r\n */\r\n export type CSSFontSize = string | number;\r\n\r\n export interface MermaidConfig {\r\n /**\r\n * Theme, the CSS style sheet.\r\n * You may also use `themeCSS` to override this value.\r\n *\r\n */\r\n theme?: 'default' | 'base' | 'dark' | 'forest' | 'neutral' | 'null';\r\n themeVariables?: any;\r\n themeCSS?: string;\r\n /**\r\n * Defines which main look to use for the diagram.\r\n *\r\n */\r\n look?: 'classic' | 'handDrawn';\r\n /**\r\n * Defines the seed to be used when using handDrawn look. This is important for the automated tests as they will always find differences without the seed. The default value is 0 which gives a random seed.\r\n *\r\n */\r\n handDrawnSeed?: number;\r\n /**\r\n * Defines which layout algorithm to use for rendering the diagram.\r\n *\r\n */\r\n layout?: string;\r\n /**\r\n * The maximum allowed size of the users text diagram\r\n */\r\n maxTextSize?: number;\r\n /**\r\n * Defines the maximum number of edges that can be drawn in a graph.\r\n *\r\n */\r\n maxEdges?: number;\r\n elk?: {\r\n /**\r\n * Elk specific option that allows edges to share path where it convenient. It can make for pretty diagrams but can also make it harder to read the diagram.\r\n *\r\n */\r\n mergeEdges?: boolean;\r\n /**\r\n * Elk specific option affecting how nodes are placed.\r\n *\r\n */\r\n nodePlacementStrategy?: 'SIMPLE' | 'NETWORK_SIMPLEX' | 'LINEAR_SEGMENTS' | 'BRANDES_KOEPF';\r\n /**\r\n * This strategy decides how to find cycles in the graph and deciding which edges need adjustment to break loops.\r\n *\r\n */\r\n cycleBreakingStrategy?:\r\n | 'GREEDY'\r\n | 'DEPTH_FIRST'\r\n | 'INTERACTIVE'\r\n | 'MODEL_ORDER'\r\n | 'GREEDY_MODEL_ORDER';\r\n };\r\n darkMode?: boolean;\r\n htmlLabels?: boolean;\r\n /**\r\n * Specifies the font to be used in the rendered diagrams.\r\n * Can be any possible CSS `font-family`.\r\n * See https://developer.mozilla.org/en-US/docs/Web/CSS/font-family\r\n *\r\n */\r\n fontFamily?: string;\r\n altFontFamily?: string;\r\n /**\r\n * This option decides the amount of logging to be used by mermaid.\r\n *\r\n */\r\n logLevel?: 'trace' | 0 | 'debug' | 1 | 'info' | 2 | 'warn' | 3 | 'error' | 4 | 'fatal' | 5;\r\n /**\r\n * Level of trust for parsed diagram\r\n */\r\n securityLevel?: 'strict' | 'loose' | 'antiscript' | 'sandbox';\r\n /**\r\n * Dictates whether mermaid starts on Page load\r\n */\r\n startOnLoad?: boolean;\r\n /**\r\n * Controls whether or arrow markers in html code are absolute paths or anchors.\r\n * This matters if you are using base tag settings.\r\n *\r\n */\r\n arrowMarkerAbsolute?: boolean;\r\n /**\r\n * This option controls which `currentConfig` keys are considered secure and\r\n * can only be changed via call to `mermaid.initialize`.\r\n * This prevents malicious graph directives from overriding a site's default security.\r\n *\r\n */\r\n secure?: string[];\r\n /**\r\n * This option specifies if Mermaid can expect the dependent to include KaTeX stylesheets for browsers\r\n * without their own MathML implementation. If this option is disabled and MathML is not supported, the math\r\n * equations are replaced with a warning. If this option is enabled and MathML is not supported, Mermaid will\r\n * fall back to legacy rendering for KaTeX.\r\n *\r\n */\r\n legacyMathML?: boolean;\r\n /**\r\n * This option forces Mermaid to rely on KaTeX's own stylesheet for rendering MathML. Due to differences between OS\r\n * fonts and browser's MathML implementation, this option is recommended if consistent rendering is important.\r\n * If set to true, ignores legacyMathML.\r\n *\r\n */\r\n forceLegacyMathML?: boolean;\r\n /**\r\n * This option controls if the generated ids of nodes in the SVG are\r\n * generated randomly or based on a seed.\r\n * If set to `false`, the IDs are generated based on the current date and\r\n * thus are not deterministic. This is the default behavior.\r\n *\r\n * This matters if your files are checked into source control e.g. git and\r\n * should not change unless content is changed.\r\n *\r\n */\r\n deterministicIds?: boolean;\r\n /**\r\n * This option is the optional seed for deterministic ids.\r\n * If set to `undefined` but deterministicIds is `true`, a simple number iterator is used.\r\n * You can set this attribute to base the seed on a static string.\r\n *\r\n */\r\n deterministicIDSeed?: string;\r\n flowchart?: FlowchartDiagramConfig;\r\n sequence?: SequenceDiagramConfig;\r\n gantt?: GanttDiagramConfig;\r\n journey?: JourneyDiagramConfig;\r\n timeline?: TimelineDiagramConfig;\r\n class?: ClassDiagramConfig;\r\n state?: StateDiagramConfig;\r\n er?: ErDiagramConfig;\r\n pie?: PieDiagramConfig;\r\n quadrantChart?: QuadrantChartConfig;\r\n xyChart?: XYChartConfig;\r\n requirement?: RequirementDiagramConfig;\r\n architecture?: ArchitectureDiagramConfig;\r\n mindmap?: MindmapDiagramConfig;\r\n kanban?: KanbanDiagramConfig;\r\n gitGraph?: GitGraphDiagramConfig;\r\n c4?: C4DiagramConfig;\r\n sankey?: SankeyDiagramConfig;\r\n packet?: PacketDiagramConfig;\r\n block?: BlockDiagramConfig;\r\n wrap?: boolean;\r\n fontSize?: number;\r\n markdownAutoWrap?: boolean;\r\n /**\r\n * Suppresses inserting 'Syntax error' diagram in the DOM.\r\n * This is useful when you want to control how to handle syntax errors in your application.\r\n *\r\n */\r\n suppressErrorRendering?: boolean;\r\n }\r\n /**\r\n * The object containing configurations specific for flowcharts\r\n *\r\n * This interface was referenced by `MermaidConfig`'s JSON-Schema\r\n * via the `definition` \"FlowchartDiagramConfig\".\r\n */\r\n export interface FlowchartDiagramConfig extends BaseDiagramConfig {\r\n /**\r\n * Margin top for the text over the diagram\r\n */\r\n titleTopMargin?: number;\r\n /**\r\n * Defines a top/bottom margin for subgraph titles\r\n *\r\n */\r\n subGraphTitleMargin?: {\r\n top?: number;\r\n bottom?: number;\r\n };\r\n arrowMarkerAbsolute?: boolean;\r\n /**\r\n * The amount of padding around the diagram as a whole so that embedded\r\n * diagrams have margins, expressed in pixels.\r\n *\r\n */\r\n diagramPadding?: number;\r\n /**\r\n * Flag for setting whether or not a html tag should be used for rendering labels on the edges.\r\n *\r\n */\r\n htmlLabels?: boolean;\r\n /**\r\n * Defines the spacing between nodes on the same level\r\n *\r\n * Pertains to horizontal spacing for TB (top to bottom) or BT (bottom to top) graphs,\r\n * and the vertical spacing for LR as well as RL graphs.\r\n *\r\n */\r\n nodeSpacing?: number;\r\n /**\r\n * Defines the spacing between nodes on different levels\r\n *\r\n * Pertains to horizontal spacing for TB (top to bottom) or BT (bottom to top) graphs,\r\n * and the vertical spacing for LR as well as RL graphs.\r\n *\r\n */\r\n rankSpacing?: number;\r\n /**\r\n * Defines how mermaid renders curves for flowcharts.\r\n *\r\n */\r\n curve?: 'basis' | 'linear' | 'cardinal';\r\n /**\r\n * Represents the padding between the labels and the shape\r\n *\r\n * **Only used in new experimental rendering.**\r\n *\r\n */\r\n padding?: number;\r\n /**\r\n * Decides which rendering engine that is to be used for the rendering.\r\n *\r\n */\r\n defaultRenderer?: 'dagre-d3' | 'dagre-wrapper' | 'elk';\r\n /**\r\n * Width of nodes where text is wrapped.\r\n *\r\n * When using markdown strings the text ius wrapped automatically, this\r\n * value sets the max width of a text before it continues on a new line.\r\n *\r\n */\r\n wrappingWidth?: number;\r\n }\r\n /**\r\n * This interface was referenced by `MermaidConfig`'s JSON-Schema\r\n * via the `definition` \"BaseDiagramConfig\".\r\n */\r\n export interface BaseDiagramConfig {\r\n useWidth?: number;\r\n /**\r\n * When this flag is set to `true`, the height and width is set to 100%\r\n * and is then scaled with the available space.\r\n * If set to `false`, the absolute space required is used.\r\n *\r\n */\r\n useMaxWidth?: boolean;\r\n }\r\n /**\r\n * The object containing configurations specific for sequence diagrams\r\n *\r\n * This interface was referenced by `MermaidConfig`'s JSON-Schema\r\n * via the `definition` \"SequenceDiagramConfig\".\r\n */\r\n export interface SequenceDiagramConfig extends BaseDiagramConfig {\r\n arrowMarkerAbsolute?: boolean;\r\n hideUnusedParticipants?: boolean;\r\n /**\r\n * Width of the activation rect\r\n */\r\n activationWidth?: number;\r\n /**\r\n * Margin to the right and left of the sequence diagram\r\n */\r\n diagramMarginX?: number;\r\n /**\r\n * Margin to the over and under the sequence diagram\r\n */\r\n diagramMarginY?: number;\r\n /**\r\n * Margin between actors\r\n */\r\n actorMargin?: number;\r\n /**\r\n * Width of actor boxes\r\n */\r\n width?: number;\r\n /**\r\n * Height of actor boxes\r\n */\r\n height?: number;\r\n /**\r\n * Margin around loop boxes\r\n */\r\n boxMargin?: number;\r\n /**\r\n * Margin around the text in loop/alt/opt boxes\r\n */\r\n boxTextMargin?: number;\r\n /**\r\n * Margin around notes\r\n */\r\n noteMargin?: number;\r\n /**\r\n * Space between messages.\r\n */\r\n messageMargin?: number;\r\n /**\r\n * Multiline message alignment\r\n */\r\n messageAlign?: 'left' | 'center' | 'right';\r\n /**\r\n * Mirror actors under diagram\r\n *\r\n */\r\n mirrorActors?: boolean;\r\n /**\r\n * forces actor popup menus to always be visible (to support E2E testing).\r\n *\r\n */\r\n forceMenus?: boolean;\r\n /**\r\n * Prolongs the edge of the diagram downwards.\r\n *\r\n * Depending on css styling this might need adjustment.\r\n *\r\n */\r\n bottomMarginAdj?: number;\r\n /**\r\n * Curved Arrows become Right Angles\r\n *\r\n * This will display arrows that start and begin at the same node as\r\n * right angles, rather than as curves.\r\n *\r\n */\r\n rightAngles?: boolean;\r\n /**\r\n * This will show the node numbers\r\n */\r\n showSequenceNumbers?: boolean;\r\n /**\r\n * This sets the font size of the actor's description\r\n */\r\n actorFontSize?: string | number;\r\n /**\r\n * This sets the font family of the actor's description\r\n */\r\n actorFontFamily?: string;\r\n /**\r\n * This sets the font weight of the actor's description\r\n */\r\n actorFontWeight?: string | number;\r\n /**\r\n * This sets the font size of actor-attached notes\r\n */\r\n noteFontSize?: string | number;\r\n /**\r\n * This sets the font family of actor-attached notes\r\n */\r\n noteFontFamily?: string;\r\n /**\r\n * This sets the font weight of actor-attached notes\r\n */\r\n noteFontWeight?: string | number;\r\n /**\r\n * This sets the text alignment of actor-attached notes\r\n */\r\n noteAlign?: 'left' | 'center' | 'right';\r\n /**\r\n * This sets the font size of actor messages\r\n */\r\n messageFontSize?: string | number;\r\n /**\r\n * This sets the font family of actor messages\r\n */\r\n messageFontFamily?: string;\r\n /**\r\n * This sets the font weight of actor messages\r\n */\r\n messageFontWeight?: string | number;\r\n /**\r\n * This sets the auto-wrap state for the diagram\r\n */\r\n wrap?: boolean;\r\n /**\r\n * This sets the auto-wrap padding for the diagram (sides only)\r\n */\r\n wrapPadding?: number;\r\n /**\r\n * This sets the width of the loop-box (loop, alt, opt, par)\r\n */\r\n labelBoxWidth?: number;\r\n /**\r\n * This sets the height of the loop-box (loop, alt, opt, par)\r\n */\r\n labelBoxHeight?: number;\r\n messageFont?: FontCalculator;\r\n noteFont?: FontCalculator;\r\n actorFont?: FontCalculator;\r\n }\r\n /**\r\n * The object containing configurations specific for gantt diagrams\r\n *\r\n *\r\n * This interface was referenced by `MermaidConfig`'s JSON-Schema\r\n * via the `definition` \"GanttDiagramConfig\".\r\n */\r\n export interface GanttDiagramConfig extends BaseDiagramConfig {\r\n /**\r\n * Margin top for the text over the diagram\r\n */\r\n titleTopMargin?: number;\r\n /**\r\n * The height of the bars in the graph\r\n */\r\n barHeight?: number;\r\n /**\r\n * The margin between the different activities in the gantt diagram\r\n */\r\n barGap?: number;\r\n /**\r\n * Margin between title and gantt diagram and between axis and gantt diagram.\r\n *\r\n */\r\n topPadding?: number;\r\n /**\r\n * The space allocated for the section name to the right of the activities\r\n *\r\n */\r\n rightPadding?: number;\r\n /**\r\n * The space allocated for the section name to the left of the activities\r\n *\r\n */\r\n leftPadding?: number;\r\n /**\r\n * Vertical starting position of the grid lines\r\n */\r\n gridLineStartPadding?: number;\r\n /**\r\n * Font size\r\n */\r\n fontSize?: number;\r\n /**\r\n * Font size for sections\r\n */\r\n sectionFontSize?: string | number;\r\n /**\r\n * The number of alternating section styles\r\n */\r\n numberSectionStyles?: number;\r\n /**\r\n * Date/time format of the axis\r\n *\r\n * This might need adjustment to match your locale and preferences.\r\n *\r\n */\r\n axisFormat?: string;\r\n /**\r\n * axis ticks\r\n *\r\n * Pattern is:\r\n *\r\n * ```javascript\r\n * /^([1-9][0-9]*)(millisecond|second|minute|hour|day|week|month)$/\r\n * ```\r\n *\r\n */\r\n tickInterval?: string;\r\n /**\r\n * When this flag is set, date labels will be added to the top of the chart\r\n *\r\n */\r\n topAxis?: boolean;\r\n /**\r\n * Controls the display mode.\r\n *\r\n */\r\n displayMode?: '' | 'compact';\r\n /**\r\n * On which day a week-based interval should start\r\n *\r\n */\r\n weekday?: 'monday' | 'tuesday' | 'wednesday' | 'thursday' | 'friday' | 'saturday' | 'sunday';\r\n }\r\n /**\r\n * The object containing configurations specific for journey diagrams\r\n *\r\n *\r\n * This interface was referenced by `MermaidConfig`'s JSON-Schema\r\n * via the `definition` \"JourneyDiagramConfig\".\r\n */\r\n export interface JourneyDiagramConfig extends BaseDiagramConfig {\r\n /**\r\n * Margin to the right and left of the c4 diagram, must be a positive value.\r\n *\r\n */\r\n diagramMarginX?: number;\r\n /**\r\n * Margin to the over and under the c4 diagram, must be a positive value.\r\n *\r\n */\r\n diagramMarginY?: number;\r\n /**\r\n * Margin between actors\r\n */\r\n leftMargin?: number;\r\n /**\r\n * Width of actor boxes\r\n */\r\n width?: number;\r\n /**\r\n * Height of actor boxes\r\n */\r\n height?: number;\r\n /**\r\n * Margin around loop boxes\r\n */\r\n boxMargin?: number;\r\n /**\r\n * Margin around the text in loop/alt/opt boxes\r\n */\r\n boxTextMargin?: number;\r\n /**\r\n * Margin around notes\r\n */\r\n noteMargin?: number;\r\n /**\r\n * Space between messages.\r\n */\r\n messageMargin?: number;\r\n /**\r\n * Multiline message alignment\r\n */\r\n messageAlign?: 'left' | 'center' | 'right';\r\n /**\r\n * Prolongs the edge of the diagram downwards.\r\n *\r\n * Depending on css styling this might need adjustment.\r\n *\r\n */\r\n bottomMarginAdj?: number;\r\n /**\r\n * Curved Arrows become Right Angles\r\n *\r\n * This will display arrows that start and begin at the same node as\r\n * right angles, rather than as curves.\r\n *\r\n */\r\n rightAngles?: boolean;\r\n taskFontSize?: string | number;\r\n taskFontFamily?: string;\r\n taskMargin?: number;\r\n /**\r\n * Width of activation box\r\n */\r\n activationWidth?: number;\r\n /**\r\n * text placement as: tspan | fo | old only text as before\r\n *\r\n */\r\n textPlacement?: string;\r\n actorColours?: string[];\r\n sectionFills?: string[];\r\n sectionColours?: string[];\r\n }\r\n /**\r\n * This interface was referenced by `MermaidConfig`'s JSON-Schema\r\n * via the `definition` \"TimelineDiagramConfig\".\r\n */\r\n export interface TimelineDiagramConfig extends BaseDiagramConfig {\r\n /**\r\n * Margin to the right and left of the c4 diagram, must be a positive value.\r\n *\r\n */\r\n diagramMarginX?: number;\r\n /**\r\n * Margin to the over and under the c4 diagram, must be a positive value.\r\n *\r\n */\r\n diagramMarginY?: number;\r\n /**\r\n * Margin between actors\r\n */\r\n leftMargin?: number;\r\n /**\r\n * Width of actor boxes\r\n */\r\n width?: number;\r\n /**\r\n * Height of actor boxes\r\n */\r\n height?: number;\r\n padding?: number;\r\n /**\r\n * Margin around loop boxes\r\n */\r\n boxMargin?: number;\r\n /**\r\n * Margin around the text in loop/alt/opt boxes\r\n */\r\n boxTextMargin?: number;\r\n /**\r\n * Margin around notes\r\n */\r\n noteMargin?: number;\r\n /**\r\n * Space between messages.\r\n */\r\n messageMargin?: number;\r\n /**\r\n * Multiline message alignment\r\n */\r\n messageAlign?: 'left' | 'center' | 'right';\r\n /**\r\n * Prolongs the edge of the diagram downwards.\r\n *\r\n * Depending on css styling this might need adjustment.\r\n *\r\n */\r\n bottomMarginAdj?: number;\r\n /**\r\n * Curved Arrows become Right Angles\r\n *\r\n * This will display arrows that start and begin at the same node as\r\n * right angles, rather than as curves.\r\n *\r\n */\r\n rightAngles?: boolean;\r\n taskFontSize?: string | number;\r\n taskFontFamily?: string;\r\n taskMargin?: number;\r\n /**\r\n * Width of activation box\r\n */\r\n activationWidth?: number;\r\n /**\r\n * text placement as: tspan | fo | old only text as before\r\n *\r\n */\r\n textPlacement?: string;\r\n actorColours?: string[];\r\n sectionFills?: string[];\r\n sectionColours?: string[];\r\n disableMulticolor?: boolean;\r\n }\r\n /**\r\n * This interface was referenced by `MermaidConfig`'s JSON-Schema\r\n * via the `definition` \"ClassDiagramConfig\".\r\n */\r\n export interface ClassDiagramConfig extends BaseDiagramConfig {\r\n /**\r\n * Margin top for the text over the diagram\r\n */\r\n titleTopMargin?: number;\r\n /**\r\n * Controls whether or arrow markers in html code are absolute paths or anchors.\r\n * This matters if you are using base tag settings.\r\n *\r\n */\r\n arrowMarkerAbsolute?: boolean;\r\n dividerMargin?: number;\r\n padding?: number;\r\n textHeight?: number;\r\n /**\r\n * Decides which rendering engine that is to be used for the rendering.\r\n *\r\n */\r\n defaultRenderer?: 'dagre-d3' | 'dagre-wrapper' | 'elk';\r\n nodeSpacing?: number;\r\n rankSpacing?: number;\r\n /**\r\n * The amount of padding around the diagram as a whole so that embedded\r\n * diagrams have margins, expressed in pixels.\r\n *\r\n */\r\n diagramPadding?: number;\r\n htmlLabels?: boolean;\r\n hideEmptyMembersBox?: boolean;\r\n }\r\n /**\r\n * The object containing configurations specific for entity relationship diagrams\r\n *\r\n * This interface was referenced by `MermaidConfig`'s JSON-Schema\r\n * via the `definition` \"StateDiagramConfig\".\r\n */\r\n export interface StateDiagramConfig extends BaseDiagramConfig {\r\n /**\r\n * Margin top for the text over the diagram\r\n */\r\n titleTopMargin?: number;\r\n arrowMarkerAbsolute?: boolean;\r\n dividerMargin?: number;\r\n sizeUnit?: number;\r\n padding?: number;\r\n textHeight?: number;\r\n titleShift?: number;\r\n noteMargin?: number;\r\n nodeSpacing?: number;\r\n rankSpacing?: number;\r\n forkWidth?: number;\r\n forkHeight?: number;\r\n miniPadding?: number;\r\n /**\r\n * Font size factor, this is used to guess the width of the edges labels\r\n * before rendering by dagre layout.\r\n * This might need updating if/when switching font\r\n *\r\n */\r\n fontSizeFactor?: number;\r\n fontSize?: number;\r\n labelHeight?: number;\r\n edgeLengthFactor?: string;\r\n compositTitleSize?: number;\r\n radius?: number;\r\n /**\r\n * Decides which rendering engine that is to be used for the rendering.\r\n *\r\n */\r\n defaultRenderer?: 'dagre-d3' | 'dagre-wrapper' | 'elk';\r\n }\r\n /**\r\n * The object containing configurations specific for entity relationship diagrams\r\n *\r\n * This interface was referenced by `MermaidConfig`'s JSON-Schema\r\n * via the `definition` \"ErDiagramConfig\".\r\n */\r\n export interface ErDiagramConfig extends BaseDiagramConfig {\r\n /**\r\n * Margin top for the text over the diagram\r\n */\r\n titleTopMargin?: number;\r\n /**\r\n * The amount of padding around the diagram as a whole so that embedded\r\n * diagrams have margins, expressed in pixels.\r\n *\r\n */\r\n diagramPadding?: number;\r\n /**\r\n * Directional bias for layout of entities\r\n */\r\n layoutDirection?: 'TB' | 'BT' | 'LR' | 'RL';\r\n /**\r\n * The minimum width of an entity box. Expressed in pixels.\r\n */\r\n minEntityWidth?: number;\r\n /**\r\n * The minimum height of an entity box. Expressed in pixels.\r\n */\r\n minEntityHeight?: number;\r\n /**\r\n * The minimum internal padding between text in an entity box and the enclosing box borders.\r\n * Expressed in pixels.\r\n *\r\n */\r\n entityPadding?: number;\r\n /**\r\n * Stroke color of box edges and lines.\r\n */\r\n stroke?: string;\r\n /**\r\n * Fill color of entity boxes\r\n */\r\n fill?: string;\r\n /**\r\n * Font size (expressed as an integer representing a number of pixels)\r\n */\r\n fontSize?: number;\r\n }\r\n /**\r\n * This interface was referenced by `MermaidConfig`'s JSON-Schema\r\n * via the `definition` \"PieDiagramConfig\".\r\n */\r\n export interface PieDiagramConfig extends BaseDiagramConfig {\r\n /**\r\n * Axial position of slice's label from zero at the center to 1 at the outside edges.\r\n *\r\n */\r\n textPosition?: number;\r\n }\r\n /**\r\n * This interface was referenced by `MermaidConfig`'s JSON-Schema\r\n * via the `definition` \"QuadrantChartConfig\".\r\n */\r\n export interface QuadrantChartConfig extends BaseDiagramConfig {\r\n /**\r\n * Width of the chart\r\n */\r\n chartWidth?: number;\r\n /**\r\n * Height of the chart\r\n */\r\n chartHeight?: number;\r\n /**\r\n * Chart title top and bottom padding\r\n */\r\n titleFontSize?: number;\r\n /**\r\n * Padding around the quadrant square\r\n */\r\n titlePadding?: number;\r\n /**\r\n * quadrant title padding from top if the quadrant is rendered on top\r\n */\r\n quadrantPadding?: number;\r\n /**\r\n * Padding around x-axis labels\r\n */\r\n xAxisLabelPadding?: number;\r\n /**\r\n * Padding around y-axis labels\r\n */\r\n yAxisLabelPadding?: number;\r\n /**\r\n * x-axis label font size\r\n */\r\n xAxisLabelFontSize?: number;\r\n /**\r\n * y-axis label font size\r\n */\r\n yAxisLabelFontSize?: number;\r\n /**\r\n * quadrant title font size\r\n */\r\n quadrantLabelFontSize?: number;\r\n /**\r\n * quadrant title padding from top if the quadrant is rendered on top\r\n */\r\n quadrantTextTopPadding?: number;\r\n /**\r\n * padding between point and point label\r\n */\r\n pointTextPadding?: number;\r\n /**\r\n * point title font size\r\n */\r\n pointLabelFontSize?: number;\r\n /**\r\n * radius of the point to be drawn\r\n */\r\n pointRadius?: number;\r\n /**\r\n * position of x-axis labels\r\n */\r\n xAxisPosition?: 'top' | 'bottom';\r\n /**\r\n * position of y-axis labels\r\n */\r\n yAxisPosition?: 'left' | 'right';\r\n /**\r\n * stroke width of edges of the box that are inside the quadrant\r\n */\r\n quadrantInternalBorderStrokeWidth?: number;\r\n /**\r\n * stroke width of edges of the box that are outside the quadrant\r\n */\r\n quadrantExternalBorderStrokeWidth?: number;\r\n }\r\n /**\r\n * This object contains configuration specific to XYCharts\r\n *\r\n * This interface was referenced by `MermaidConfig`'s JSON-Schema\r\n * via the `definition` \"XYChartConfig\".\r\n */\r\n export interface XYChartConfig extends BaseDiagramConfig {\r\n /**\r\n * width of the chart\r\n */\r\n width?: number;\r\n /**\r\n * height of the chart\r\n */\r\n height?: number;\r\n /**\r\n * Font size of the chart title\r\n */\r\n titleFontSize?: number;\r\n /**\r\n * Top and bottom space from the chart title\r\n */\r\n titlePadding?: number;\r\n /**\r\n * Should show the chart title\r\n */\r\n showTitle?: boolean;\r\n xAxis?: XYChartAxisConfig;\r\n yAxis?: XYChartAxisConfig;\r\n /**\r\n * How to plot will be drawn horizontal or vertical\r\n */\r\n chartOrientation?: 'vertical' | 'horizontal';\r\n /**\r\n * Minimum percent of space plots of the chart will take\r\n */\r\n plotReservedSpacePercent?: number;\r\n }\r\n /**\r\n * This object contains configuration for XYChart axis config\r\n *\r\n * This interface was referenced by `MermaidConfig`'s JSON-Schema\r\n * via the `definition` \"XYChartAxisConfig\".\r\n */\r\n export interface XYChartAxisConfig {\r\n /**\r\n * Should show the axis labels (tick text)\r\n */\r\n showLabel?: boolean;\r\n /**\r\n * font size of the axis labels (tick text)\r\n */\r\n labelFontSize?: number;\r\n /**\r\n * top and bottom space from axis label (tick text)\r\n */\r\n labelPadding?: number;\r\n /**\r\n * Should show the axis title\r\n */\r\n showTitle?: boolean;\r\n /**\r\n * font size of the axis title\r\n */\r\n titleFontSize?: number;\r\n /**\r\n * top and bottom space from axis title\r\n */\r\n titlePadding?: number;\r\n /**\r\n * Should show the axis tick lines\r\n */\r\n showTick?: boolean;\r\n /**\r\n * length of the axis tick lines\r\n */\r\n tickLength?: number;\r\n /**\r\n * width of the axis tick lines\r\n */\r\n tickWidth?: number;\r\n /**\r\n * Show line across the axis\r\n */\r\n showAxisLine?: boolean;\r\n /**\r\n * Width of the axis line\r\n */\r\n axisLineWidth?: number;\r\n }\r\n /**\r\n * The object containing configurations specific for req diagrams\r\n *\r\n * This interface was referenced by `MermaidConfig`'s JSON-Schema\r\n * via the `definition` \"RequirementDiagramConfig\".\r\n */\r\n export interface RequirementDiagramConfig extends BaseDiagramConfig {\r\n rect_fill?: string;\r\n text_color?: string;\r\n rect_border_size?: string;\r\n rect_border_color?: string;\r\n rect_min_width?: number;\r\n rect_min_height?: number;\r\n fontSize?: number;\r\n rect_padding?: number;\r\n line_height?: number;\r\n }\r\n /**\r\n * The object containing configurations specific for architecture diagrams\r\n *\r\n * This interface was referenced by `MermaidConfig`'s JSON-Schema\r\n * via the `definition` \"ArchitectureDiagramConfig\".\r\n */\r\n export interface ArchitectureDiagramConfig extends BaseDiagramConfig {\r\n padding?: number;\r\n iconSize?: number;\r\n fontSize?: number;\r\n }\r\n /**\r\n * The object containing configurations specific for mindmap diagrams\r\n *\r\n * This interface was referenced by `MermaidConfig`'s JSON-Schema\r\n * via the `definition` \"MindmapDiagramConfig\".\r\n */\r\n export interface MindmapDiagramConfig extends BaseDiagramConfig {\r\n padding?: number;\r\n maxNodeWidth?: number;\r\n }\r\n /**\r\n * The object containing configurations specific for kanban diagrams\r\n *\r\n * This interface was referenced by `MermaidConfig`'s JSON-Schema\r\n * via the `definition` \"KanbanDiagramConfig\".\r\n */\r\n export interface KanbanDiagramConfig extends BaseDiagramConfig {\r\n padding?: number;\r\n sectionWidth?: number;\r\n ticketBaseUrl?: string;\r\n }\r\n /**\r\n * This interface was referenced by `MermaidConfig`'s JSON-Schema\r\n * via the `definition` \"GitGraphDiagramConfig\".\r\n */\r\n export interface GitGraphDiagramConfig extends BaseDiagramConfig {\r\n /**\r\n * Margin top for the text over the diagram\r\n */\r\n titleTopMargin?: number;\r\n diagramPadding?: number;\r\n nodeLabel?: NodeLabel;\r\n mainBranchName?: string;\r\n mainBranchOrder?: number;\r\n showCommitLabel?: boolean;\r\n showBranches?: boolean;\r\n rotateCommitLabel?: boolean;\r\n parallelCommits?: boolean;\r\n /**\r\n * Controls whether or arrow markers in html code are absolute paths or anchors.\r\n * This matters if you are using base tag settings.\r\n *\r\n */\r\n arrowMarkerAbsolute?: boolean;\r\n }\r\n /**\r\n * This interface was referenced by `MermaidConfig`'s JSON-Schema\r\n * via the `definition` \"NodeLabel\".\r\n */\r\n export interface NodeLabel {\r\n width?: number;\r\n height?: number;\r\n x?: number;\r\n y?: number;\r\n }\r\n /**\r\n * The object containing configurations specific for c4 diagrams\r\n *\r\n * This interface was referenced by `MermaidConfig`'s JSON-Schema\r\n * via the `definition` \"C4DiagramConfig\".\r\n */\r\n export interface C4DiagramConfig extends BaseDiagramConfig {\r\n /**\r\n * Margin to the right and left of the c4 diagram, must be a positive value.\r\n *\r\n */\r\n diagramMarginX?: number;\r\n /**\r\n * Margin to the over and under the c4 diagram, must be a positive value.\r\n *\r\n */\r\n diagramMarginY?: number;\r\n /**\r\n * Margin between shapes\r\n */\r\n c4ShapeMargin?: number;\r\n /**\r\n * Padding between shapes\r\n */\r\n c4ShapePadding?: number;\r\n /**\r\n * Width of person boxes\r\n */\r\n width?: number;\r\n /**\r\n * Height of person boxes\r\n */\r\n height?: number;\r\n /**\r\n * Margin around boxes\r\n */\r\n boxMargin?: number;\r\n /**\r\n * How many shapes to place in each row.\r\n */\r\n c4ShapeInRow?: number;\r\n nextLinePaddingX?: number;\r\n /**\r\n * How many boundaries to place in each row.\r\n */\r\n c4BoundaryInRow?: number;\r\n /**\r\n * This sets the font size of Person shape for the diagram\r\n */\r\n personFontSize?: string | number;\r\n /**\r\n * This sets the font weight of Person shape for the diagram\r\n */\r\n personFontFamily?: string;\r\n /**\r\n * This sets the font weight of Person shape for the diagram\r\n */\r\n personFontWeight?: string | number;\r\n /**\r\n * This sets the font size of External Person shape for the diagram\r\n */\r\n external_personFontSize?: string | number;\r\n /**\r\n * This sets the font family of External Person shape for the diagram\r\n */\r\n external_personFontFamily?: string;\r\n /**\r\n * This sets the font weight of External Person shape for the diagram\r\n */\r\n external_personFontWeight?: string | number;\r\n /**\r\n * This sets the font size of System shape for the diagram\r\n */\r\n systemFontSize?: string | number;\r\n /**\r\n * This sets the font family of System shape for the diagram\r\n */\r\n systemFontFamily?: string;\r\n /**\r\n * This sets the font weight of System shape for the diagram\r\n */\r\n systemFontWeight?: string | number;\r\n /**\r\n * This sets the font size of External System shape for the diagram\r\n */\r\n external_systemFontSize?: string | number;\r\n /**\r\n * This sets the font family of External System shape for the diagram\r\n */\r\n external_systemFontFamily?: string;\r\n /**\r\n * This sets the font weight of External System shape for the diagram\r\n */\r\n external_systemFontWeight?: string | number;\r\n /**\r\n * This sets the font size of System DB shape for the diagram\r\n */\r\n system_dbFontSize?: string | number;\r\n /**\r\n * This sets the font family of System DB shape for the diagram\r\n */\r\n system_dbFontFamily?: string;\r\n /**\r\n * This sets the font weight of System DB shape for the diagram\r\n */\r\n system_dbFontWeight?: string | number;\r\n /**\r\n * This sets the font size of External System DB shape for the diagram\r\n */\r\n external_system_dbFontSize?: string | number;\r\n /**\r\n * This sets the font family of External System DB shape for the diagram\r\n */\r\n external_system_dbFontFamily?: string;\r\n /**\r\n * This sets the font weight of External System DB shape for the diagram\r\n */\r\n external_system_dbFontWeight?: string | number;\r\n /**\r\n * This sets the font size of System Queue shape for the diagram\r\n */\r\n system_queueFontSize?: string | number;\r\n /**\r\n * This sets the font family of System Queue shape for the diagram\r\n */\r\n system_queueFontFamily?: string;\r\n /**\r\n * This sets the font weight of System Queue shape for the diagram\r\n */\r\n system_queueFontWeight?: string | number;\r\n /**\r\n * This sets the font size of External System Queue shape for the diagram\r\n */\r\n external_system_queueFontSize?: string | number;\r\n /**\r\n * This sets the font family of External System Queue shape for the diagram\r\n */\r\n external_system_queueFontFamily?: string;\r\n /**\r\n * This sets the font weight of External System Queue shape for the diagram\r\n */\r\n external_system_queueFontWeight?: string | number;\r\n /**\r\n * This sets the font size of Boundary shape for the diagram\r\n */\r\n boundaryFontSize?: string | number;\r\n /**\r\n * This sets the font family of Boundary shape for the diagram\r\n */\r\n boundaryFontFamily?: string;\r\n /**\r\n * This sets the font weight of Boundary shape for the diagram\r\n */\r\n boundaryFontWeight?: string | number;\r\n /**\r\n * This sets the font size of Message shape for the diagram\r\n */\r\n messageFontSize?: string | number;\r\n /**\r\n * This sets the font family of Message shape for the diagram\r\n */\r\n messageFontFamily?: string;\r\n /**\r\n * This sets the font weight of Message shape for the diagram\r\n */\r\n messageFontWeight?: string | number;\r\n /**\r\n * This sets the font size of Container shape for the diagram\r\n */\r\n containerFontSize?: string | number;\r\n /**\r\n * This sets the font family of Container shape for the diagram\r\n */\r\n containerFontFamily?: string;\r\n /**\r\n * This sets the font weight of Container shape for the diagram\r\n */\r\n containerFontWeight?: string | number;\r\n /**\r\n * This sets the font size of External Container shape for the diagram\r\n */\r\n external_containerFontSize?: string | number;\r\n /**\r\n * This sets the font family of External Container shape for the diagram\r\n */\r\n external_containerFontFamily?: string;\r\n /**\r\n * This sets the font weight of External Container shape for the diagram\r\n */\r\n external_containerFontWeight?: string | number;\r\n /**\r\n * This sets the font size of Container DB shape for the diagram\r\n */\r\n container_dbFontSize?: string | number;\r\n /**\r\n * This sets the font family of Container DB shape for the diagram\r\n */\r\n container_dbFontFamily?: string;\r\n /**\r\n * This sets the font weight of Container DB shape for the diagram\r\n */\r\n container_dbFontWeight?: string | number;\r\n /**\r\n * This sets the font size of External Container DB shape for the diagram\r\n */\r\n external_container_dbFontSize?: string | number;\r\n /**\r\n * This sets the font family of External Container DB shape for the diagram\r\n */\r\n external_container_dbFontFamily?: string;\r\n /**\r\n * This sets the font weight of External Container DB shape for the diagram\r\n */\r\n external_container_dbFontWeight?: string | number;\r\n /**\r\n * This sets the font size of Container Queue shape for the diagram\r\n */\r\n container_queueFontSize?: string | number;\r\n /**\r\n * This sets the font family of Container Queue shape for the diagram\r\n */\r\n container_queueFontFamily?: string;\r\n /**\r\n * This sets the font weight of Container Queue shape for the diagram\r\n */\r\n container_queueFontWeight?: string | number;\r\n /**\r\n * This sets the font size of External Container Queue shape for the diagram\r\n */\r\n external_container_queueFontSize?: string | number;\r\n /**\r\n * This sets the font family of External Container Queue shape for the diagram\r\n */\r\n external_container_queueFontFamily?: string;\r\n /**\r\n * This sets the font weight of External Container Queue shape for the diagram\r\n */\r\n external_container_queueFontWeight?: string | number;\r\n /**\r\n * This sets the font size of Component shape for the diagram\r\n */\r\n componentFontSize?: string | number;\r\n /**\r\n * This sets the font family of Component shape for the diagram\r\n */\r\n componentFontFamily?: string;\r\n /**\r\n * This sets the font weight of Component shape for the diagram\r\n */\r\n componentFontWeight?: string | number;\r\n /**\r\n * This sets the font size of External Component shape for the diagram\r\n */\r\n external_componentFontSize?: string | number;\r\n /**\r\n * This sets the font family of External Component shape for the diagram\r\n */\r\n external_componentFontFamily?: string;\r\n /**\r\n * This sets the font weight of External Component shape for the diagram\r\n */\r\n external_componentFontWeight?: string | number;\r\n /**\r\n * This sets the font size of Component DB shape for the diagram\r\n */\r\n component_dbFontSize?: string | number;\r\n /**\r\n * This sets the font family of Component DB shape for the diagram\r\n */\r\n component_dbFontFamily?: string;\r\n /**\r\n * This sets the font weight of Component DB shape for the diagram\r\n */\r\n component_dbFontWeight?: string | number;\r\n /**\r\n * This sets the font size of External Component DB shape for the diagram\r\n */\r\n external_component_dbFontSize?: string | number;\r\n /**\r\n * This sets the font family of External Component DB shape for the diagram\r\n */\r\n external_component_dbFontFamily?: string;\r\n /**\r\n * This sets the font weight of External Component DB shape for the diagram\r\n */\r\n external_component_dbFontWeight?: string | number;\r\n /**\r\n * This sets the font size of Component Queue shape for the diagram\r\n */\r\n component_queueFontSize?: string | number;\r\n /**\r\n * This sets the font family of Component Queue shape for the diagram\r\n */\r\n component_queueFontFamily?: string;\r\n /**\r\n * This sets the font weight of Component Queue shape for the diagram\r\n */\r\n component_queueFontWeight?: string | number;\r\n /**\r\n * This sets the font size of External Component Queue shape for the diagram\r\n */\r\n external_component_queueFontSize?: string | number;\r\n /**\r\n * This sets the font family of External Component Queue shape for the diagram\r\n */\r\n external_component_queueFontFamily?: string;\r\n /**\r\n * This sets the font weight of External Component Queue shape for the diagram\r\n */\r\n external_component_queueFontWeight?: string | number;\r\n /**\r\n * This sets the auto-wrap state for the diagram\r\n */\r\n wrap?: boolean;\r\n /**\r\n * This sets the auto-wrap padding for the diagram (sides only)\r\n */\r\n wrapPadding?: number;\r\n person_bg_color?: string;\r\n person_border_color?: string;\r\n external_person_bg_color?: string;\r\n external_person_border_color?: string;\r\n system_bg_color?: string;\r\n system_border_color?: string;\r\n system_db_bg_color?: string;\r\n system_db_border_color?: string;\r\n system_queue_bg_color?: string;\r\n system_queue_border_color?: string;\r\n external_system_bg_color?: string;\r\n external_system_border_color?: string;\r\n external_system_db_bg_color?: string;\r\n external_system_db_border_color?: string;\r\n external_system_queue_bg_color?: string;\r\n external_system_queue_border_color?: string;\r\n container_bg_color?: string;\r\n container_border_color?: string;\r\n container_db_bg_color?: string;\r\n container_db_border_color?: string;\r\n container_queue_bg_color?: string;\r\n container_queue_border_color?: string;\r\n external_container_bg_color?: string;\r\n external_container_border_color?: string;\r\n external_container_db_bg_color?: string;\r\n external_container_db_border_color?: string;\r\n external_container_queue_bg_color?: string;\r\n external_container_queue_border_color?: string;\r\n component_bg_color?: string;\r\n component_border_color?: string;\r\n component_db_bg_color?: string;\r\n component_db_border_color?: string;\r\n component_queue_bg_color?: string;\r\n component_queue_border_color?: string;\r\n external_component_bg_color?: string;\r\n external_component_border_color?: string;\r\n external_component_db_bg_color?: string;\r\n external_component_db_border_color?: string;\r\n external_component_queue_bg_color?: string;\r\n external_component_queue_border_color?: string;\r\n personFont?: FontCalculator;\r\n external_personFont?: FontCalculator;\r\n systemFont?: FontCalculator;\r\n external_systemFont?: FontCalculator;\r\n system_dbFont?: FontCalculator;\r\n external_system_dbFont?: FontCalculator;\r\n system_queueFont?: FontCalculator;\r\n external_system_queueFont?: FontCalculator;\r\n containerFont?: FontCalculator;\r\n external_containerFont?: FontCalculator;\r\n container_dbFont?: FontCalculator;\r\n external_container_dbFont?: FontCalculator;\r\n container_queueFont?: FontCalculator;\r\n external_container_queueFont?: FontCalculator;\r\n componentFont?: FontCalculator;\r\n external_componentFont?: FontCalculator;\r\n component_dbFont?: FontCalculator;\r\n external_component_dbFont?: FontCalculator;\r\n component_queueFont?: FontCalculator;\r\n external_component_queueFont?: FontCalculator;\r\n boundaryFont?: FontCalculator;\r\n messageFont?: FontCalculator;\r\n }\r\n /**\r\n * The object containing configurations specific for sankey diagrams.\r\n *\r\n * This interface was referenced by `MermaidConfig`'s JSON-Schema\r\n * via the `definition` \"SankeyDiagramConfig\".\r\n */\r\n export interface SankeyDiagramConfig extends BaseDiagramConfig {\r\n width?: number;\r\n height?: number;\r\n /**\r\n * The color of the links in the sankey diagram.\r\n *\r\n */\r\n linkColor?: SankeyLinkColor | string;\r\n nodeAlignment?: SankeyNodeAlignment;\r\n useMaxWidth?: boolean;\r\n /**\r\n * Toggle to display or hide values along with title.\r\n *\r\n */\r\n showValues?: boolean;\r\n /**\r\n * The prefix to use for values\r\n *\r\n */\r\n prefix?: string;\r\n /**\r\n * The suffix to use for values\r\n *\r\n */\r\n suffix?: string;\r\n }\r\n /**\r\n * The object containing configurations specific for packet diagrams.\r\n *\r\n * This interface was referenced by `MermaidConfig`'s JSON-Schema\r\n * via the `definition` \"PacketDiagramConfig\".\r\n */\r\n export interface PacketDiagramConfig extends BaseDiagramConfig {\r\n /**\r\n * The height of each row in the packet diagram.\r\n */\r\n rowHeight?: number;\r\n /**\r\n * The width of each bit in the packet diagram.\r\n */\r\n bitWidth?: number;\r\n /**\r\n * The number of bits to display per row.\r\n */\r\n bitsPerRow?: number;\r\n /**\r\n * Toggle to display or hide bit numbers.\r\n */\r\n showBits?: boolean;\r\n /**\r\n * The horizontal padding between the blocks in a row.\r\n */\r\n paddingX?: number;\r\n /**\r\n * The vertical padding between the rows.\r\n */\r\n paddingY?: number;\r\n }\r\n /**\r\n * The object containing configurations specific for block diagrams.\r\n *\r\n * This interface was referenced by `MermaidConfig`'s JSON-Schema\r\n * via the `definition` \"BlockDiagramConfig\".\r\n */\r\n export interface BlockDiagramConfig extends BaseDiagramConfig {\r\n padding?: number;\r\n }\r\n /**\r\n * This interface was referenced by `MermaidConfig`'s JSON-Schema\r\n * via the `definition` \"FontConfig\".\r\n */\r\n export interface FontConfig {\r\n fontSize?: CSSFontSize;\r\n /**\r\n * The CSS [`font-family`](https://developer.mozilla.org/en-US/docs/Web/CSS/font-family) to use.\r\n */\r\n fontFamily?: string;\r\n /**\r\n * The font weight to use.\r\n */\r\n fontWeight?: string | number;\r\n }\r\n /**\r\n * Optional runtime configs.\r\n */\r\n export interface RunOptions {\r\n /**\r\n * The query selector to use when finding elements to render. Default: `\".mermaid\"`.\r\n */\r\n querySelector?: string;\r\n /**\r\n * The nodes to render. If this is set, `querySelector` will be ignored.\r\n */\r\n nodes?: ArrayLike<HTMLElement>;\r\n /**\r\n * A callback to call after each diagram is rendered.\r\n */\r\n postRenderCallback?: (id: string) => unknown;\r\n /**\r\n * If `true`, errors will be logged to the console, but not thrown. Default: `false`\r\n */\r\n suppressErrors?: boolean;\r\n }\r\n}","import { InjectionToken, SecurityContext } from '@angular/core';\r\n\r\nexport const SANITIZE = new InjectionToken<SecurityContext | SanitizeFunction>('SANITIZE');\r\n\r\nexport type SanitizeFunction = (html: string) => string;\r\n\r\nexport function isSanitizeFunction(sanitize: SecurityContext | SanitizeFunction | null): sanitize is SanitizeFunction {\r\n return typeof sanitize === 'function';\r\n}\r\n","import { isPlatformBrowser } from '@angular/common';\r\nimport { HttpClient } from '@angular/common/http';\r\nimport { EmbeddedViewRef, inject, Injectable, PLATFORM_ID, SecurityContext, ViewContainerRef } from '@angular/core';\r\nimport { DomSanitizer } from '@angular/platform-browser';\r\nimport { marked, MarkedExtension, Renderer } from 'marked';\r\nimport { Observable, Subject } from 'rxjs';\r\nimport { map } from 'rxjs/operators';\r\nimport { ClipboardButtonComponent } from './clipboard-button.component';\r\nimport { CLIPBOARD_OPTIONS, ClipboardOptions, ClipboardRenderOptions } from './clipboard-options';\r\nimport { KatexOptions } from './katex-options';\r\nimport { MARKED_EXTENSIONS } from './marked-extensions';\r\nimport { MARKED_OPTIONS, MarkedOptions } from './marked-options';\r\nimport { MarkedRenderer } from './marked-renderer';\r\nimport { MERMAID_OPTIONS, MermaidAPI } from './mermaid-options';\r\nimport { isSanitizeFunction, SANITIZE } from './sanitize-options';\r\n\r\n// clipboard\r\ndeclare let ClipboardJS: {\r\n new(\r\n selector: string | Element | NodeListOf<Element>,\r\n options?: { text?: (elem: Element) => string },\r\n ): typeof ClipboardJS;\r\n destroy(): void;\r\n};\r\n\r\n// emoji\r\ndeclare let joypixels: {\r\n shortnameToUnicode(input: string): string;\r\n};\r\n\r\n// katex\r\ndeclare let katex: unknown;\r\ndeclare function renderMathInElement(elem: HTMLElement, options?: KatexOptions): void;\r\n\r\n// mermaid\r\ndeclare let mermaid: {\r\n initialize: (options: MermaidAPI.MermaidConfig) => void;\r\n run: (runOptions: MermaidAPI.RunOptions) => void;\r\n};\r\n\r\n// prism\r\ndeclare let Prism: {\r\n highlightAllUnder: (element: Element | Document) => void;\r\n};\r\n\r\nexport const errorJoyPixelsNotLoaded = '[ngx-markdown] When using the `emoji` attribute you *have to* include Emoji-Toolkit files to `angular.json` or use imports. See README for more information';\r\nexport const errorKatexNotLoaded = '[ngx-markdown] When using the `katex` attribute you *have to* include KaTeX files to `angular.json` or use imports. See README for more information';\r\nexport const errorMermaidNotLoaded = '[ngx-markdown] When using the `mermaid` attribute you *have to* include Mermaid files to `angular.json` or use imports. See README for more information';\r\nexport const errorClipboardNotLoaded = '[ngx-markdown] When using the `clipboard` attribute you *have to* include Clipboard files to `angular.json` or use imports. See README for more information';\r\nexport const errorClipboardViewContainerRequired = '[ngx-markdown] When using the `clipboard` attribute you *have to* provide the `viewContainerRef` parameter to `MarkdownService.render()` function';\r\nexport const errorSrcWithoutHttpClient = '[ngx-markdown] When using the `src` attribute you *have to* pass the `HttpClient` as a parameter of the `forRoot` method. See README for more information';\r\n\r\nexport interface ParseOptions {\r\n decodeHtml?: boolean;\r\n inline?: boolean;\r\n emoji?: boolean;\r\n mermaid?: boolean;\r\n markedOptions?: MarkedOptions;\r\n disableSanitizer?: boolean;\r\n}\r\n\r\nexport interface RenderOptions {\r\n clipboard?: boolean;\r\n clipboardOptions?: ClipboardRenderOptions;\r\n katex?: boolean;\r\n katexOptions?: KatexOptions;\r\n mermaid?: boolean;\r\n mermaidOptions?: MermaidAPI.MermaidConfig;\r\n}\r\n\r\nexport class ExtendedRenderer extends Renderer {\r\n ɵNgxMarkdownRendererExtendedForExtensions = false;\r\n ɵNgxMarkdownRendererExtendedForMermaid = false;\r\n}\r\n\r\n@Injectable()\r\nexport class MarkdownService {\r\n private clipboardOptions = inject(CLIPBOARD_OPTIONS, { optional: true });\r\n private extensions = inject<MarkedExtension[]>(MARKED_EXTENSIONS, { optional: true });\r\n private http = inject(HttpClient, { optional: true });\r\n private mermaidOptions = inject(MERMAID_OPTIONS, { optional: true });\r\n private platform = inject(PLATFORM_ID);\r\n private sanitize = inject(SANITIZE, { optional: true });\r\n private sanitizer = inject(DomSanitizer);\r\n\r\n private readonly DEFAULT_MARKED_OPTIONS: MarkedOptions = {\r\n renderer: new MarkedRenderer(),\r\n };\r\n\r\n private readonly DEFAULT_KATEX_OPTIONS: KatexOptions = {\r\n delimiters: [\r\n { left: '$$', right: '$$', display: true },\r\n { left: '$', right: '$', display: false },\r\n { left: '\\\\(', right: '\\\\)', display: false },\r\n { left: '\\\\begin{equation}', right: '\\\\end{equation}', display: true },\r\n { left: '\\\\begin{align}', right: '\\\\end{align}', display: true },\r\n { left: '\\\\begin{alignat}', right: '\\\\end{alignat}', display: true },\r\n { left: '\\\\begin{gather}', right: '\\\\end{gather}', display: true },\r\n { left: '\\\\begin{CD}', right: '\\\\end{CD}', display: true },\r\n { left: '\\\\[', right: '\\\\]', display: true },\r\n ],\r\n };\r\n\r\n private readonly DEFAULT_MERMAID_OPTIONS: MermaidAPI.MermaidConfig = {\r\n startOnLoad: false,\r\n };\r\n\r\n private readonly DEFAULT_CLIPBOARD_OPTIONS: ClipboardOptions = {\r\n buttonComponent: undefined,\r\n };\r\n\r\n private readonly DEFAULT_PARSE_OPTIONS: ParseOptions = {\r\n decodeHtml: false,\r\n inline: false,\r\n emoji: false,\r\n mermaid: false,\r\n markedOptions: undefined,\r\n disableSanitizer: false,\r\n };\r\n\r\n private readonly DEFAULT_RENDER_OPTIONS: RenderOptions = {\r\n clipboard: false,\r\n clipboardOptions: undefined,\r\n katex: false,\r\n katexOptions: undefined,\r\n mermaid: false,\r\n mermaidOptions: undefined,\r\n };\r\n\r\n private readonly DEFAULT_SECURITY_CONTEXT = SecurityContext.HTML;\r\n\r\n private _options: MarkedOptions | null = null;\r\n\r\n get options(): MarkedOptions { return this._options!; }\r\n set options(value: MarkedOptions | null) {\r\n this._options = { ...this.DEFAULT_MARKED_OPTIONS, ...value };\r\n }\r\n\r\n get renderer(): MarkedRenderer { return this.options.renderer!; }\r\n set renderer(value: MarkedRenderer) {\r\n this.options.renderer = value;\r\n }\r\n\r\n private readonly _reload$ = new Subject<void>();\r\n readonly reload$ = this._reload$.asObservable();\r\n\r\n constructor() {\r\n this.options = inject<MarkedOptions>(MARKED_OPTIONS, { optional: true });\r\n }\r\n\r\n parse(markdown: string, parseOptions: ParseOptions = this.DEFAULT_PARSE_OPTIONS): string | Promise<string> {\r\n const {\r\n decodeHtml,\r\n inline,\r\n emoji,\r\n mermaid,\r\n disableSanitizer,\r\n } = parseOptions;\r\n\r\n const markedOptions = {\r\n ...this.options,\r\n ...parseOptions.markedOptions,\r\n };\r\n\r\n const renderer = markedOptions.renderer || this.renderer || new Renderer();\r\n\r\n if (this.extensions) {\r\n this.renderer = this.extendsRendererForExtensions(renderer);\r\n }\r\n\r\n if (mermaid) {\r\n this.renderer = this.extendsRendererForMermaid(renderer);\r\n }\r\n\r\n const trimmed = this.trimIndentation(markdown);\r\n const decoded = decodeHtml ? this.decodeHtml(trimmed) : trimmed;\r\n const emojified = emoji ? this.parseEmoji(decoded) : decoded;\r\n const marked = this.parseMarked(emojified, markedOptions, inline);\r\n const sanitized = disableSanitizer ? marked : this.sanitizeHtml(marked);\r\n\r\n return sanitized;\r\n }\r\n\r\n render(element: HTMLElement, options: RenderOptions = this.DEFAULT_RENDER_OPTIONS, viewContainerRef?: ViewContainerRef): void {\r\n const {\r\n clipboard,\r\n clipboardOptions,\r\n katex,\r\n katexOptions,\r\n mermaid,\r\n mermaidOptions,\r\n } = options;\r\n\r\n if (katex) {\r\n this.renderKatex(element, {\r\n ...this.DEFAULT_KATEX_OPTIONS,\r\n ...katexOptions,\r\n });\r\n }\r\n if (mermaid) {\r\n this.renderMermaid(element, {\r\n ...this.DEFAULT_MERMAID_OPTIONS,\r\n ...this.mermaidOptions,\r\n ...mermaidOptions,\r\n });\r\n }\r\n if (clipboard) {\r\n this.renderClipboard(element, viewContainerRef, {\r\n ...this.DEFAULT_CLIPBOARD_OPTIONS,\r\n ...this.clipboardOptions,\r\n ...clipboardOptions,\r\n });\r\n }\r\n\r\n this.highlight(element);\r\n }\r\n\r\n reload(): void {\r\n this._reload$.next();\r\n }\r\n\r\n getSource(src: string): Observable<string> {\r\n if (!this.http) {\r\n throw new Error(errorSrcWithoutHttpClient);\r\n }\r\n return this.http\r\n .get(src, { responseType: 'text' })\r\n .pipe(map(markdown => this.handleExtension(src, markdown)));\r\n }\r\n\r\n highlight(element?: Element | Document): void {\r\n if (!isPlatformBrowser(this.platform)) {\r\n return;\r\n }\r\n if (typeof Prism === 'undefined' || typeof Prism.highlightAllUnder === 'undefined') {\r\n return;\r\n }\r\n if (!element) {\r\n element = document;\r\n }\r\n const noLanguageElements = element.querySelectorAll('pre code:not([class*=\"language-\"])');\r\n Array.prototype.forEach.call(noLanguageElements, (x: Element) => x.classList.add('language-none'));\r\n Prism.highlightAllUnder(element);\r\n }\r\n\r\n private decodeHtml(html: string): string {\r\n if (!isPlatformBrowser(this.platform)) {\r\n return html;\r\n }\r\n const textarea = document.createElement('textarea');\r\n textarea.innerHTML = html;\r\n return textarea.value;\r\n }\r\n\r\n private extendsRendererForExtensions(renderer: Renderer): Renderer {\r\n const extendedRenderer = renderer as ExtendedRenderer;\r\n if (extendedRenderer.ɵNgxMarkdownRendererExtendedForExtensions === true) {\r\n return renderer;\r\n }\r\n\r\n if (this.extensions && this.extensions.length > 0) {\r\n marked.use(...this.extensions);\r\n }\r\n\r\n extendedRenderer.ɵNgxMarkdownRendererExtendedForExtensions = true;\r\n\r\n return renderer;\r\n }\r\n\r\n private extendsRendererForMermaid(renderer: Renderer): Renderer {\r\n const extendedRenderer = renderer as ExtendedRenderer;\r\n if (extendedRenderer.ɵNgxMarkdownRendererExtendedForMermaid === true) {\r\n return renderer;\r\n }\r\n\r\n const defaultCode = renderer.code;\r\n renderer.code = (token) => {\r\n return token.lang === 'mermaid'\r\n ? `<div class=\"mermaid\">${token.text}</div>`\r\n : defaultCode(token);\r\n };\r\n\r\n extendedRenderer.ɵNgxMarkdownRendererExtendedForMermaid = true;\r\n\r\n return renderer;\r\n }\r\n\r\n private handleExtension(src: string, markdown: string): string {\r\n const urlProtocolIndex = src.lastIndexOf('://');\r\n const urlWithoutProtocol = urlProtocolIndex > -1\r\n ? src.substring(urlProtocolIndex + 4)\r\n : src;\r\n\r\n const lastSlashIndex = urlWithoutProtocol.lastIndexOf('/');\r\n const lastUrlSegment = lastSlashIndex > -1\r\n ? urlWithoutProtocol.substring(lastSlashIndex + 1).split('?')[0]\r\n : '';\r\n\r\n const lastDotIndex = lastUrlSegment.lastIndexOf('.');\r\n const extension = lastDotIndex > -1\r\n ? lastUrlSegment.substring(lastDotIndex + 1)\r\n : '';\r\n\r\n return !!extension && extension !== 'md'\r\n ? '```' + extension + '\\n' + markdown + '\\n```'\r\n : markdown;\r\n }\r\n\r\n private parseMarked(html: string, markedOptions: MarkedOptions, inline = false): string | Promise<string> {\r\n if (markedOptions.renderer) {\r\n // clone renderer and remove extended flags otherwise\r\n // marked throws an error thinking it is a renderer prop\r\n const renderer = { ...markedOptions.renderer } as Partial<ExtendedRenderer>;\r\n delete renderer.ɵNgxMarkdownRendererExtendedForExtensions;\r\n delete renderer.ɵNgxMarkdownRendererExtendedForMermaid;\r\n\r\n // remove renderer from markedOptions because if renderer is\r\n // passed to marked.parse method, it will ignore all extensions\r\n delete markedOptions.renderer;\r\n\r\n marked.use({ renderer });\r\n }\r\n\r\n return inline\r\n ? marked.parseInline(html, markedOptions)\r\n : marked.parse(html, markedOptions);\r\n }\r\n\r\n private parseEmoji(html: string): string {\r\n if (!isPlatformBrowser(this.platform)) {\r\n return html;\r\n }\r\n if (typeof joypixels === 'undefined' || typeof joypixels.shortnameToUnicode === 'undefined') {\r\n throw new Error(errorJoyPixelsNotLoaded);\r\n }\r\n return joypixels.shortnameToUnicode(html);\r\n }\r\n\r\n private renderKatex(element: HTMLElement, options: KatexOptions): void {\r\n if (!isPlatformBrowser(this.platform)) {\r\n return;\r\n }\r\n if (typeof katex === 'undefined' || typeof renderMathInElement === 'undefined') {\r\n throw new Error(errorKatexNotLoaded);\r\n }\r\n renderMathInElement(element, options);\r\n }\r\n\r\n private renderClipboard(element: HTMLElement, viewContainerRef: ViewContainerRef | undefined, options: ClipboardRenderOptions): void {\r\n if (!isPlatformBrowser(this.platform)) {\r\n return;\r\n }\r\n if (typeof ClipboardJS === 'undefined') {\r\n throw new Error(errorClipboardNotLoaded);\r\n }\r\n if (!viewContainerRef) {\r\n throw new Error(errorClipboardViewContainerRequired);\r\n }\r\n\r\n const {\r\n buttonComponent,\r\n buttonTemplate,\r\n } = options;\r\n\r\n // target every <pre> elements\r\n const preElements = element.querySelectorAll('pre');\r\n for (let i = 0; i < preElements.length; i++) {\r\n const preElement = preElements.item(i);\r\n\r\n // create <pre> wrapper element\r\n const preWrapperElement = document.createElement('div');\r\n preWrapperElement.style.position = 'relative';\r\n preElement.parentNode!.insertBefore(preWrapperElement, preElement);\r\n preWrapperElement.appendChild(preElement);\r\n\r\n // create toolbar element\r\n const toolbarWrapperElement = document.createElement('div');\r\n toolbarWrapperElement.classList.add('markdown-clipboard-toolbar');\r\n toolbarWrapperElement.style.position = 'absolute';\r\n toolbarWrapperElement.style.top = '.5em';\r\n toolbarWrapperElement.style.right = '.5em';\r\n toolbarWrapperElement.style.zIndex = '1';\r\n preWrapperElement.insertAdjacentElement('beforeend', toolbarWrapperElement);\r\n\r\n // register listener to show/hide toolbar\r\n preWrapperElement.onmouseenter = () => toolbarWrapperElement.classList.add('hover');\r\n preWrapperElement.onmouseleave = () => toolbarWrapperElement.classList.remove('hover');\r\n\r\n // declare embeddedViewRef holding variable\r\n let embeddedViewRef: EmbeddedViewRef<unknown>;\r\n\r\n // use provided component via input property\r\n // or provided via ClipboardOptions provider\r\n if (buttonComponent) {\r\n const componentRef = viewContainerRef.createComponent(buttonComponent);\r\n embeddedViewRef = componentRef.hostView as EmbeddedViewRef<unknown>;\r\n componentRef.changeDetectorRef.markForCheck();\r\n }\r\n // use provided template via input property\r\n else if (buttonTemplate) {\r\n embeddedViewRef = viewContainerRef.createEmbeddedView(buttonTemplate);\r\n }\r\n // use default component\r\n else {\r\n const componentRef = viewContainerRef.createComponent(ClipboardButtonComponent);\r\n embeddedViewRef = componentRef.hostView as EmbeddedViewRef<unknown>;\r\n componentRef.changeDetectorRef.markForCheck();\r\n }\r\n\r\n // declare clipboard instance variable\r\n let clipboardInstance: typeof ClipboardJS;\r\n\r\n // attach clipboard.js to root node\r\n embeddedViewRef.rootNodes.forEach((node: HTMLElement) => {\r\n toolbarWrapperElement.appendChild(node);\r\n clipboardInstance = new ClipboardJS(node, { text: () => preElement.innerText });\r\n });\r\n\r\n // destroy clipboard instance when view is destroyed\r\n embeddedViewRef.onDestroy(() => clipboardInstance.destroy());\r\n }\r\n }\r\n\r\n private renderMermaid(element: HTMLElement, options: MermaidAPI.MermaidConfig = this.DEFAULT_MERMAID_OPTIONS): void {\r\n if (!isPlatformBrowser(this.platform)) {\r\n return;\r\n }\r\n if (typeof mermaid === 'undefined' || typeof mermaid.initialize === 'undefined') {\r\n throw new Error(errorMermaidNotLoaded);\r\n }\r\n const mermaidElements = element.querySelectorAll<HTMLElement>('.mermaid');\r\n if (mermaidElements.length === 0) {\r\n return;\r\n }\r\n mermaid.initialize(options);\r\n mermaid.run({ nodes: mermaidElements });\r\n }\r\n\r\n private trimIndentation(markdown: string): string {\r\n if (!markdown) {\r\n return '';\r\n }\r\n let indentStart: number;\r\n return markdown\r\n .split('\\n')\r\n .map(line => {\r\n let lineIdentStart = indentStart;\r\n if (line.length > 0) {\r\n lineIdentStart = isNaN(lineIdentStart)\r\n ? line.search(/\\S|$/)\r\n : Math.min(line.search(/\\S|$/), lineIdentStart);\r\n }\r\n if (isNaN(indentStart)) {\r\n indentStart = lineIdentStart;\r\n }\r\n return lineIdentStart\r\n ? line.substring(lineIdentStart)\r\n : line;\r\n }).join('\\n');\r\n }\r\n\r\n private async sanitizeHtml(html: string | Promise<string>): Promise<string> {\r\n if (isSanitizeFunction(this.sanitize)) {\r\n return this.sanitize(await html);\r\n }\r\n if (this.sanitize !== SecurityContext.NONE) {\r\n return this.sanitizer.sanitize(this.sanitize ?? this.DEFAULT_SECURITY_CONTEXT, html) ?? '';\r\n }\r\n return html;\r\n }\r\n}\r\n","export enum PrismPlugin {\r\n CommandLine = 'command-line',\r\n LineHighlight = 'line-highlight',\r\n LineNumbers = 'line-numbers',\r\n}\r\n","import { AfterViewInit, Component, ElementRef, EventEmitter, inject, Input, OnChanges, OnDestroy, Output, TemplateRef, Type, ViewContainerRef } from '@angular/core';\r\nimport { Subject } from 'rxjs';\r\nimport { takeUntil } from 'rxjs/operators';\r\nimport { ClipboardRenderOptions } from './clipboard-options';\r\nimport { KatexOptions } from './katex-options';\r\nimport { MarkdownService, ParseOptions, RenderOptions } from './markdown.service';\r\nimport { MermaidAPI } from './mermaid-options';\r\nimport { PrismPlugin } from './prism-plugin';\r\n\r\n@Component({\r\n // eslint-disable-next-line @angular-eslint/component-selector\r\n selector: 'markdown, [markdown]',\r\n template: '<ng-content></ng-content>',\r\n})\r\nexport class MarkdownComponent implements OnChanges, AfterViewInit, OnDestroy {\r\n element = inject<ElementRef<HTMLElement>>(ElementRef);\r\n markdownService = inject(MarkdownService);\r\n viewContainerRef = inject(ViewContainerRef);\r\n\r\n protected static ngAcceptInputType_clipboard: boolean | '';\r\n protected static ngAcceptInputType_emoji: boolean | '';\r\n protected static ngAcceptInputType_katex: boolean | '';\r\n protected static ngAcceptInputType_mermaid: boolean | '';\r\n protected static ngAcceptInputType_lineHighlight: boolean | '';\r\n protected static ngAcceptInputType_lineNumbers: boolean | '';\r\n protected static ngAcceptInputType_commandLine: boolean | '';\r\n\r\n @Input() data: string | null | undefined;\r\n @Input() src: string | null | undefined;\r\n\r\n @Input()\r\n get disableSanitizer(): boolean { return this._disableSanitizer; }\r\n set disableSanitizer(value: boolean) { this._disableSanitizer = this.coerceBooleanProperty(value); }\r\n\r\n @Input()\r\n get inline(): boolean { return this._inline; }\r\n set inline(value: boolean) { this._inline = this.coerceBooleanProperty(value); }\r\n\r\n // Plugin - clipboard\r\n @Input()\r\n get clipboard(): boolean { return this._clipboard; }\r\n set clipboard(value: boolean) { this._clipboard = this.coerceBooleanProperty(value); }\r\n\r\n @Input() clipboardButtonComponent: Type<unknown> | undefined;\r\n @Input() clipboardButtonTemplate: TemplateRef<unknown> | undefined;\r\n\r\n // Plugin - emoji\r\n @Input()\r\n get emoji(): boolean { return this._emoji; }\r\n set emoji(value: boolean) { this._emoji = this.coerceBooleanProperty(value); }\r\n\r\n // Plugin - katex\r\n @Input()\r\n get katex(): boolean { return this._katex; }\r\n set katex(value: boolean) { this._katex = this.coerceBooleanProperty(value); }\r\n\r\n @Input() katexOptions: KatexOptions | undefined;\r\n\r\n // Plugin - mermaid\r\n @Input()\r\n get mermaid(): boolean { return this._mermaid; }\r\n set mermaid(value: boolean) { this._mermaid = this.coerceBooleanProperty(value); }\r\n\r\n @Input() mermaidOptions: MermaidAPI.MermaidConfig | undefined;\r\n\r\n // Plugin - lineHighlight\r\n @Input()\r\n get lineHighlight(): boolean { return this._lineHighlight; }\r\n set lineHighlight(value: boolean) { this._lineHighlight = this.coerceBooleanProperty(value); }\r\n\r\n @Input() line: string | string[] | undefined;\r\n @Input() lineOffset: number | undefined;\r\n\r\n // Plugin - lineNumbers\r\n @Input()\r\n get lineNumbers(): boolean { return this._lineNumbers; }\r\n set lineNumbers(value: boolean) { this._lineNumbers = this.coerceBooleanProperty(value); }\r\n\r\n @Input() start: number | undefined;\r\n\r\n // Plugin - commandLine\r\n @Input()\r\n get commandLine(): boolean { return this._commandLine; }\r\n set commandLine(value: boolean) { this._commandLine = this.coerceBooleanProperty(value); }\r\n\r\n @Input() filterOutput: string | undefined;\r\n @Input() host: string | undefined;\r\n @Input() prompt: string | undefined;\r\n @Input() output: string | undefined;\r\n @Input() user: string | undefined;\r\n\r\n // Event emitters\r\n @Output() error = new EventEmitter<string | Error>();\r\n @Output() load = new EventEmitter<string>();\r\n @Output() ready = new EventEmitter<void>();\r\n\r\n private _clipboard = false;\r\n private _commandLine = false;\r\n private _disableSanitizer = false;\r\n private _emoji = false;\r\n private _inline = false;\r\n private _katex = false;\r\n private _lineHighlight = false;\r\n private _lineNumbers = false;\r\n private _mermaid = false;\r\n\r\n private readonly destroyed$ = new Subject<void>();\r\n\r\n ngOnChanges(): void {\r\n this.loadContent();\r\n }\r\n\r\n loadContent(): void {\r\n if (this.data != null) {\r\n this.handleData();\r\n return;\r\n }\r\n if (this.src != null) {\r\n this.handleSrc();\r\n return;\r\n }\r\n }\r\n\r\n ngAfterViewInit(): void {\r\n if (!this.data && !this.src) {\r\n this.handleTransclusion();\r\n }\r\n\r\n this.markdownService.reload$\r\n .pipe(takeUntil(this.destroyed$))\r\n .subscribe(() => this.loadContent());\r\n }\r\n\r\n ngOnDestroy(): void {\r\n this.destroyed$.next();\r\n this.destroyed$.complete();\r\n }\r\n\r\n async render(markdown: string, decodeHtml = false): Promise<void> {\r\n const parsedOptions: ParseOptions = {\r\n decodeHtml,\r\n inline: this.inline,\r\n emoji: this.emoji,\r\n mermaid: this.mermaid,\r\n disableSanitizer: this.disableSanitizer,\r\n };\r\n\r\n const renderOptions: RenderOptions = {\r\n clipboard: this.clipboard,\r\n clipboardOptions: this.getClipboardOptions(),\r\n katex: this.katex,\r\n katexOptions: this.katexOptions,\r\n mermaid: this.mermaid,\r\n mermaidOptions: this.mermaidOptions,\r\n };\r\n\r\n const parsed = await this.markdownService.parse(markdown, parsedOptions);\r\n\r\n this.element.nativeElement.innerHTML = parsed;\r\n\r\n this.handlePlugins();\r\n\r\n this.markdownService.render(this.element.nativeElement, renderOptions, this.viewContainerRef);\r\n\r\n this.ready.emit();\r\n }\r\n\r\n private coerceBooleanProperty(value: boolean | ''): boolean {\r\n return value != null && `${String(value)}` !== 'false';\r\n }\r\n\r\n private getClipboardOptions(): ClipboardRenderOptions | undefined {\r\n if (this.clipboardButtonComponent || this.clipboardButtonTemplate) {\r\n return {\r\n buttonComponent: this.clipboardButtonComponent,\r\n buttonTemplate: this.clipboardButtonTemplate,\r\n };\r\n }\r\n return undefined;\r\n }\r\n\r\n private handleData(): void {\r\n this.render(this.data!);\r\n }\r\n\r\n private handleSrc(): void {\r\n this.markdownService\r\n .getSource(this.src!)\r\n .subscribe({\r\n next: markdown => {\r\n this.render(markdown).then(() => {\r\n this.load.emit(markdown);\r\n });\r\n },\r\n error: (error: string | Error) => this.error.emit(error),\r\n });\r\n }\r\n\r\n private handleTransclusion(): void {\r\n this.render(this.element.nativeElement.innerHTML, true);\r\n }\r\n\r\n private handlePlugins(): void {\r\n if (this.commandLine) {\r\n this.setPluginClass(this.element.nativeElement, PrismPlugin.CommandLine);\r\n this.setPluginOptions(this.element.nativeElement, {\r\n dataFilterOutput: this.filterOutput,\r\n dataHost: this.host,\r\n dataPrompt: this.prompt,\r\n dataOutput: this.output,\r\n dataUser: this.user,\r\n });\r\n }\r\n if (this.lineHighlight) {\r\n this.setPluginOptions(this.element.nativeElement, { dataLine: this.line, dataLineOffset: this.lineOffset });\r\n }\r\n if (this.lineNumbers) {\r\n this.setPluginClass(this.element.nativeElement, PrismPlugin.LineNumbers);\r\n this.setPluginOptions(this.element.nativeElement, { dataStart: this.start });\r\n }\r\n }\r\n\r\n private setPluginClass(element: HTMLElement, plugin: string | string[]): void {\r\n const preElements = element.querySelectorAll('pre');\r\n for (let i = 0; i < preElements.length; i++) {\r\n const classes = plugin instanceof Array ? plugin : [plugin];\r\n preElements.item(i).classList.add(...classes);\r\n }\r\n }\r\n\r\n private setPluginOptions(element: HTMLElement, options: Record<string, number | string | string[] | undefined>): void {\r\n const preElements = element.querySelectorAll('pre');\r\n for (let i = 0; i < preElements.length; i++) {\r\n Object.keys(options).forEach(option => {\r\n const attributeValue = options[option];\r\n if (attributeValue) {\r\n const attributeName = this.toLispCase(option);\r\n preElements.item(i).setAttribute(attributeName, attributeValue.toString());\r\n }\r\n });\r\n }\r\n }\r\n\r\n private toLispCase(value: string): string {\r\n const upperChars = value.match(/([A-Z])/g);\r\n if (!upperChars) {\r\n return value;\r\n }\r\n let str = value.toString();\r\n for (let i = 0, n = upperChars.length; i < n; i++) {\r\n str = str.replace(new RegExp(upperChars[i]), '-' + upperChars[i].toLowerCase());\r\n }\r\n if (str.slice(0, 1) === '-') {\r\n str = str.slice(1);\r\n }\r\n return str;\r\n }\r\n}\r\n","import { ElementRef, inject, NgZone, Pipe, PipeTransform, ViewContainerRef } from '@angular/core';\r\nimport { DomSanitizer, SafeHtml } from '@angular/platform-browser';\r\nimport { first } from 'rxjs/operators';\r\nimport { MarkdownService, ParseOptions, RenderOptions } from './markdown.service';\r\n\r\nexport type MarkdownPipeOptions = ParseOptions & RenderOptions;\r\n\r\n@Pipe({\r\n name: 'markdown',\r\n})\r\nexport class MarkdownPipe implements PipeTransform {\r\n private domSanitizer = inject(DomSanitizer);\r\n private elementRef = inject<ElementRef<HTMLElement>>(ElementRef);\r\n private markdownService = inject(MarkdownService);\r\n private viewContainerRef = inject(ViewContainerRef);\r\n private zone = inject(NgZone);\r\n\r\n async transform(value: string, options?: MarkdownPipeOptions): Promise<SafeHtml> {\r\n if (value == null) {\r\n return '';\r\n }\r\n\r\n if (typeof value !== 'string') {\r\n console.error(`MarkdownPipe has been invoked with an invalid value type [${typeof value}]`);\r\n return value;\r\n }\r\n\r\n const markdown = await this.markdownService.parse(value, options);\r\n\r\n this.zone.onStable\r\n .pipe(first())\r\n .subscribe(() => this.markdownService.render(this.elementRef.nativeElement, options, this.viewContainerRef));\r\n\r\n return this.domSanitizer.bypassSecurityTrustHtml(markdown);\r\n }\r\n}\r\n","import { Provider } from '@angular/core';\r\nimport { MarkdownModuleConfig } from './markdown.module';\r\nimport { MarkdownService } from './markdown.service';\r\n\r\nexport function provideMarkdown(markdownModuleConfig?: MarkdownModuleConfig): Provider[] {\r\n return [\r\n MarkdownService,\r\n markdownModuleConfig?.loader ?? [],\r\n markdownModuleConfig?.clipboardOptions ?? [],\r\n markdownModuleConfig?.markedOptions ?? [],\r\n markdownModuleConfig?.mermaidOptions ?? [],\r\n markdownModuleConfig?.markedExtensions ?? [],\r\n markdownModuleConfig?.sanitize ?? [],\r\n ];\r\n}\r\n","import { InjectionToken, ModuleWithProviders, NgModule, Provider } from '@angular/core';\r\nimport { ClipboardButtonComponent } from './clipboard-button.component';\r\nimport { CLIPBOARD_OPTIONS } from './clipboard-options';\r\nimport { LanguagePipe } from './language.pipe';\r\nimport { MarkdownComponent } from './markdown.component';\r\nimport { MarkdownPipe } from './markdown.pipe';\r\nimport { MARKED_EXTENSIONS } from './marked-extensions';\r\nimport { MARKED_OPTIONS } from './marked-options';\r\nimport { MERMAID_OPTIONS } from './mermaid-options';\r\nimport { provideMarkdown } from './provide-markdown';\r\nimport { SANITIZE } from './sanitize-options';\r\n\r\ntype InjectionTokenType<T extends InjectionToken<any>> = T extends InjectionToken<infer R> ? R : unknown;\r\n\r\ninterface TypedValueProvider<T extends InjectionToken<any>> {\r\n provide: T;\r\n useValue: InjectionTokenType<T>;\r\n};\r\n\r\ninterface TypedFactoryProvider<T extends InjectionToken<any>> {\r\n provide: T;\r\n useFactory: (...args: any[]) => InjectionTokenType<T>;\r\n deps?: any[];\r\n};\r\n\r\ntype TypedProvider<T extends InjectionToken<any>> = TypedValueProvider<T> | TypedFactoryProvider<T>;\r\n\r\ntype MultiTypedProvider<T extends InjectionToken<any>> = TypedProvider<T> & { multi: true };\r\n\r\n// having a dependency on `HttpClientModule` within a library\r\n// breaks all the interceptors from the app consuming the library\r\n// here, we explicitely ask the user to pass a provider with\r\n// their own instance of `HttpClientModule`\r\nexport interface MarkdownModuleConfig {\r\n loader?: Provider;\r\n clipboardOptions?: TypedProvider<typeof CLIPBOARD_OPTIONS>;\r\n markedOptions?: TypedProvider<typeof MARKED_OPTIONS>;\r\n markedExtensions?: MultiTypedProvider<typeof MARKED_EXTENSIONS>[];\r\n mermaidOptions?: TypedProvider<typeof MERMAID_OPTIONS>;\r\n sanitize?: TypedProvider<typeof SANITIZE>;\r\n}\r\n\r\nconst sharedDeclarations = [\r\n ClipboardButtonComponent,\r\n LanguagePipe,\r\n MarkdownComponent,\r\n MarkdownPipe,\r\n];\r\n\r\n@NgModule({\r\n imports: sharedDeclarations,\r\n exports: sharedDeclarations,\r\n})\r\nexport class MarkdownModule {\r\n static forRoot(markdownModuleConfig?: MarkdownModuleConfig): ModuleWithProviders<MarkdownModule> {\r\n return {\r\n ngModule: MarkdownModule,\r\n providers: [\r\n provideMarkdown(markdownModuleConfig),\r\n ],\r\n };\r\n }\r\n\r\n static forChild(): ModuleWithProviders<MarkdownModule> {\r\n return {\r\n ngModule: MarkdownModule,\r\n };\r\n }\r\n}\r\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './public_api';\n"],"names":["MarkedRenderer"],"mappings":";;;;;;;;;;;AAKA,MAAM,gBAAgB,GAAG,MAAM;AAC/B,MAAM,kBAAkB,GAAG,QAAQ;MAatB,wBAAwB,CAAA;AAXrC,IAAA,WAAA,GAAA;AAYU,QAAA,IAAA,CAAA,aAAa,GAAG,IAAI,OAAO,EAAQ;QAElC,IAAA,CAAA,MAAM,GAAG,QAAQ,CACxB,IAAI,CAAC,aAAa,CAAC,IAAI,CACrB,SAAS,CAAC,MAAM,KAAK,CACnB,EAAE,CAAC,IAAI,CAAC,EACR,KAAK,CAAC,IAAI,CAAC,CAAC,IAAI,CAAC,KAAK,CAAC,KAAK,CAAC,CAAC,CAC/B,CAAC,EAC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