@f1studio/form-spec 5.0.0-alpha.101 → 5.0.0-alpha.103

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (161) hide show
  1. package/Components/HelloComponent.d.ts +20 -0
  2. package/Components/HelloComponent.d.ts.map +1 -0
  3. package/Designer.d.ts.map +1 -0
  4. package/FormSpec.TS/Designer.js +2 -2
  5. package/FormSpec.TS/Designer.js.map +1 -1
  6. package/FormSpec.TS/Designer.ts.map +1 -1
  7. package/FormSpec.TS/FormSpec.js +210 -143
  8. package/FormSpec.TS/FormSpec.js.map +1 -1
  9. package/FormSpec.TS/FormSpec.ts.map +1 -1
  10. package/FormSpec.TS/FormSpecHelpers.js +62 -40
  11. package/FormSpec.TS/FormSpecHelpers.js.map +1 -1
  12. package/FormSpec.TS/FormSpecHelpers.ts.map +1 -1
  13. package/FormSpec.TS/FormSpecValues.js +207 -0
  14. package/FormSpec.TS/FormSpecValues.js.map +1 -0
  15. package/FormSpec.TS/FormSpecValues.ts.map +1 -0
  16. package/FormSpec.TS/Helpers.js +26 -25
  17. package/FormSpec.TS/Helpers.js.map +1 -1
  18. package/FormSpec.TS/Helpers.ts.map +1 -1
  19. package/FormSpec.TS/Interop/FormSpec.Api.Helpers.js +85 -125
  20. package/FormSpec.TS/Interop/FormSpec.Api.Helpers.js.map +1 -1
  21. package/FormSpec.TS/Interop/FormSpec.Api.Helpers.ts.map +1 -1
  22. package/FormSpec.TS/Interop/FormSpec.Api.Option.js +37 -7
  23. package/FormSpec.TS/Interop/FormSpec.Api.Option.js.map +1 -1
  24. package/FormSpec.TS/Interop/FormSpec.Api.Option.ts.map +1 -1
  25. package/FormSpec.TS/Interop/FormSpec.Values.Api.Option.js +103 -80
  26. package/FormSpec.TS/Interop/FormSpec.Values.Api.Option.js.map +1 -1
  27. package/FormSpec.TS/Interop/FormSpec.Values.Api.Option.ts.map +1 -1
  28. package/FormSpec.TS/PathwayExecutor.js +371 -125
  29. package/FormSpec.TS/PathwayExecutor.js.map +1 -1
  30. package/FormSpec.TS/PathwayExecutor.ts.map +1 -1
  31. package/FormSpec.TS/PathwayValidator.js +14 -26
  32. package/FormSpec.TS/PathwayValidator.js.map +1 -1
  33. package/FormSpec.TS/PathwayValidator.ts.map +1 -1
  34. package/FormSpec.TS/Renderers/FormSpecMarkdownRenderer.ts.map +1 -1
  35. package/FormSpec.TS/Renderers/PathwayRenderers.js +35 -26
  36. package/FormSpec.TS/Renderers/PathwayRenderers.js.map +1 -1
  37. package/FormSpec.TS/Renderers/PathwayRenderers.ts.map +1 -1
  38. package/FormSpec.TS/fable_modules/Fable.Form.3.0.0/Base.fs +0 -0
  39. package/FormSpec.TS/fable_modules/Fable.Form.3.0.0/Error.fs +0 -0
  40. package/FormSpec.TS/fable_modules/Fable.Form.3.0.0/Extensions.fs +0 -0
  41. package/FormSpec.TS/fable_modules/Fable.Form.3.0.0/Fable.Form.fableproj +0 -0
  42. package/FormSpec.TS/fable_modules/Fable.Form.3.0.0/Field.fs +0 -0
  43. package/FormSpec.TS/fable_modules/Fable.Form.Simple.5.0.1/Fable.Form.Simple.fableproj +0 -0
  44. package/FormSpec.TS/fable_modules/Fable.Form.Simple.5.0.1/Form.fs +0 -0
  45. package/FormSpec.TS/fable_modules/Fable.React.Types.18.3.0/Fable.React.Extensions.fs +0 -0
  46. package/FormSpec.TS/fable_modules/Fable.React.Types.18.3.0/Fable.React.Hooks.fs +0 -0
  47. package/FormSpec.TS/fable_modules/Fable.React.Types.18.3.0/Fable.React.Types.fableproj +0 -0
  48. package/FormSpec.TS/fable_modules/Fable.React.Types.18.3.0/Fable.React.fs +0 -0
  49. package/FormSpec.TS/fable_modules/Fable.ReactDom.Types.18.2.0/Fable.ReactDom.Types.fableproj +0 -0
  50. package/FormSpec.TS/fable_modules/Fable.ReactDom.Types.18.2.0/Fable.ReactDom.fs +0 -0
  51. package/FormSpec.TS/fable_modules/Feliz.2.7.0/BorderStyle.fs +0 -0
  52. package/FormSpec.TS/fable_modules/Feliz.2.7.0/Colors.fs +0 -0
  53. package/FormSpec.TS/fable_modules/Feliz.2.7.0/Feliz.fableproj +0 -0
  54. package/FormSpec.TS/fable_modules/Feliz.2.7.0/Fonts.fs +0 -0
  55. package/FormSpec.TS/fable_modules/Feliz.2.7.0/GridTypes.fs +0 -0
  56. package/FormSpec.TS/fable_modules/Feliz.2.7.0/Html.fs +0 -0
  57. package/FormSpec.TS/fable_modules/Feliz.2.7.0/Interop.fs +0 -0
  58. package/FormSpec.TS/fable_modules/Feliz.2.7.0/Key.fs +0 -0
  59. package/FormSpec.TS/fable_modules/Feliz.2.7.0/Length.fs +0 -0
  60. package/FormSpec.TS/fable_modules/Feliz.2.7.0/Locale.fs +0 -0
  61. package/FormSpec.TS/fable_modules/Feliz.2.7.0/Properties.fs +0 -0
  62. package/FormSpec.TS/fable_modules/Feliz.2.7.0/React.fs +0 -0
  63. package/FormSpec.TS/fable_modules/Feliz.2.7.0/ReactDOM.fs +0 -0
  64. package/FormSpec.TS/fable_modules/Feliz.2.7.0/ReactInterop.js +0 -0
  65. package/FormSpec.TS/fable_modules/Feliz.2.7.0/ReactInterop.js.map +0 -0
  66. package/FormSpec.TS/fable_modules/Feliz.2.7.0/ReactTypes.fs +0 -0
  67. package/FormSpec.TS/fable_modules/Feliz.2.7.0/StyleTypes.fs +0 -0
  68. package/FormSpec.TS/fable_modules/Feliz.2.7.0/Styles.fs +0 -0
  69. package/FormSpec.TS/fable_modules/Feliz.2.7.0/Svg.fs +0 -0
  70. package/FormSpec.TS/fable_modules/Feliz.2.7.0/TextDecorationLine.fs +0 -0
  71. package/FormSpec.TS/fable_modules/Feliz.2.7.0/TextDecorationStyle.fs +0 -0
  72. package/FormSpec.TS/fable_modules/Feliz.2.7.0/Transform.fs +0 -0
  73. package/FormSpec.TS/fable_modules/Feliz.2.7.0/TransformOrigin.fs +0 -0
  74. package/FormSpec.TS/fable_modules/Feliz.2.7.0/TransitionProperty.fs +0 -0
  75. package/FormSpec.TS/fable_modules/Feliz.2.7.0/Types.fs +0 -0
  76. package/FormSpec.TS/fable_modules/Thoth.Json.10.4.1/Decode.fs +0 -0
  77. package/FormSpec.TS/fable_modules/Thoth.Json.10.4.1/Encode.fs +0 -0
  78. package/FormSpec.TS/fable_modules/Thoth.Json.10.4.1/Encode.fs.js.map +1 -1
  79. package/FormSpec.TS/fable_modules/Thoth.Json.10.4.1/Encode.fs.ts.map +1 -1
  80. package/FormSpec.TS/fable_modules/Thoth.Json.10.4.1/Extra.fs +0 -0
  81. package/FormSpec.TS/fable_modules/Thoth.Json.10.4.1/Thoth.Json.fableproj +0 -0
  82. package/FormSpec.TS/fable_modules/Thoth.Json.10.4.1/Types.fs +0 -0
  83. package/FormSpec.TS/fable_modules/project_cracked.json +1 -1
  84. package/FormSpec.d.ts +56 -43
  85. package/FormSpec.d.ts.map +1 -0
  86. package/FormSpecHelpers.d.ts +18 -12
  87. package/FormSpecHelpers.d.ts.map +1 -0
  88. package/FormSpecValues.d.ts +62 -0
  89. package/FormSpecValues.d.ts.map +1 -0
  90. package/Helpers.d.ts +11 -10
  91. package/Helpers.d.ts.map +1 -0
  92. package/Interfaces.d.ts.map +1 -0
  93. package/Interop/FormSpec.Api.Helpers.d.ts +25 -28
  94. package/Interop/FormSpec.Api.Helpers.d.ts.map +1 -1
  95. package/Interop/FormSpec.Api.Option.d.ts +10 -6
  96. package/Interop/FormSpec.Api.Option.d.ts.map +1 -1
  97. package/Interop/FormSpec.Values.Api.Option.d.ts +35 -22
  98. package/Interop/FormSpec.Values.Api.Option.d.ts.map +1 -1
  99. package/Logging/LogTypes.d.ts +112 -0
  100. package/Logging/LogTypes.d.ts.map +1 -0
  101. package/Migrator.d.ts.map +1 -0
  102. package/PathwayDataExtractor.d.ts.map +1 -0
  103. package/PathwayExecutor.d.ts +63 -33
  104. package/PathwayExecutor.d.ts.map +1 -0
  105. package/PathwayValidator.d.ts.map +1 -0
  106. package/PluginInterface.d.ts.map +1 -0
  107. package/Prelude.d.ts.map +1 -0
  108. package/README.TS.md +621 -621
  109. package/README.md +98 -85
  110. package/Renderers/FormSpecMarkdownRenderer.d.ts +11 -0
  111. package/Renderers/FormSpecMarkdownRenderer.d.ts.map +1 -0
  112. package/Renderers/MermaidRenderer.d.ts +48 -0
  113. package/Renderers/MermaidRenderer.d.ts.map +1 -0
  114. package/Renderers/PathwayRenderers.d.ts +59 -0
  115. package/Renderers/PathwayRenderers.d.ts.map +1 -0
  116. package/fable_modules/Thoth.Json.10.4.1/Decode.fs.d.ts +126 -0
  117. package/fable_modules/Thoth.Json.10.4.1/Decode.fs.d.ts.map +1 -0
  118. package/fable_modules/Thoth.Json.10.4.1/Encode.fs.d.ts +163 -0
  119. package/fable_modules/Thoth.Json.10.4.1/Encode.fs.d.ts.map +1 -0
  120. package/fable_modules/Thoth.Json.10.4.1/Types.fs.d.ts +66 -0
  121. package/fable_modules/Thoth.Json.10.4.1/Types.fs.d.ts.map +1 -0
  122. package/package.json +53 -39
  123. package/src/Components/HelloComponent.ts +48 -48
  124. package/src/Designer.ts +389 -389
  125. package/src/FormSpec.ts +3154 -3114
  126. package/src/FormSpecHelpers.ts +397 -374
  127. package/src/FormSpecValues.ts +158 -0
  128. package/src/Helpers.ts +766 -765
  129. package/src/Interfaces.ts +166 -166
  130. package/src/Interop/FormSpec.Api.Helpers.ts +835 -872
  131. package/src/Interop/FormSpec.Api.Option.ts +1637 -1618
  132. package/src/Interop/FormSpec.Values.Api.Option.ts +1241 -1214
  133. package/src/Logging/LogTypes.ts +212 -212
  134. package/src/Migrator.ts +156 -156
  135. package/src/PathwayDataExtractor.ts +290 -290
  136. package/src/PathwayExecutor.ts +1379 -1102
  137. package/src/PathwayValidator.ts +238 -244
  138. package/src/PluginInterface.ts +79 -79
  139. package/src/Prelude.ts +21 -21
  140. package/src/Renderers/FormSpecMarkdownRenderer.ts +875 -874
  141. package/src/Renderers/MermaidRenderer.ts +218 -218
  142. package/src/Renderers/PathwayRenderers.ts +208 -200
  143. package/src/Components/HelloComponent.ts.map +0 -1
  144. package/src/Designer.ts.map +0 -1
  145. package/src/FormSpec.ts.map +0 -1
  146. package/src/FormSpecHelpers.ts.map +0 -1
  147. package/src/Helpers.ts.map +0 -1
  148. package/src/Interfaces.ts.map +0 -1
  149. package/src/Interop/FormSpec.Api.Helpers.ts.map +0 -1
  150. package/src/Interop/FormSpec.Api.Option.ts.map +0 -1
  151. package/src/Interop/FormSpec.Values.Api.Option.ts.map +0 -1
  152. package/src/Logging/LogTypes.ts.map +0 -1
  153. package/src/Migrator.ts.map +0 -1
  154. package/src/PathwayDataExtractor.ts.map +0 -1
  155. package/src/PathwayExecutor.ts.map +0 -1
  156. package/src/PathwayValidator.ts.map +0 -1
  157. package/src/PluginInterface.ts.map +0 -1
  158. package/src/Prelude.ts.map +0 -1
  159. package/src/Renderers/FormSpecMarkdownRenderer.ts.map +0 -1
  160. package/src/Renderers/MermaidRenderer.ts.map +0 -1
  161. package/src/Renderers/PathwayRenderers.ts.map +0 -1
@@ -1,218 +1,218 @@
1
- import { StringBuilder_$ctor, StringBuilder__AppendLine_Z721C83C5 } from "@fable-org/fable-library-js/System.Text.js";
2
- import { sanitizeMermaidText, getTerminalOutcome, extractActionText, extractEvaluationName, extractDecisionDetails, stateTypeToString, extractStateKeyString, sanitizeMermaidId } from "../PathwayDataExtractor.js";
3
- import { isNullOrEmpty, join, printf, toText } from "@fable-org/fable-library-js/String.js";
4
- import { empty, exists, isEmpty, iterateIndexed, mapIndexed, cons, FSharpList, map } from "@fable-org/fable-library-js/List.js";
5
- import { ClinicalPathway_PathRequirement, ClinicalPathway_ConstraintDefinition, ClinicalPathway_ClinicalPathwaySpec, ClinicalPathway_TransitionDefinition, ClinicalPathway_StateType_$union, ClinicalPathway_StateDefinition, ClinicalPathway_ActionInfo_$union } from "../FormSpec.js";
6
- import { toString } from "@fable-org/fable-library-js/Types.js";
7
- import { int32, float64 } from "@fable-org/fable-library-js/Int32.js";
8
- import { formatRequiredPathLabel, formatConstraintLabel, isTransitionRequired, getTransitionArrowStyle, IGraphRenderer$3 } from "./PathwayRenderers.js";
9
- import { class_type, TypeInfo } from "@fable-org/fable-library-js/Reflection.js";
10
- import { value as value_23, Option } from "@fable-org/fable-library-js/Option.js";
11
-
12
- export class MermaidRenderer implements IGraphRenderer$3<void, void, string> {
13
- readonly withMarkdownFences: boolean;
14
- readonly sb: any;
15
- constructor(withMarkdownFences: boolean) {
16
- this.withMarkdownFences = withMarkdownFences;
17
- this.sb = StringBuilder_$ctor();
18
- }
19
- StartGraph(pathwayName: string, version: string): void {
20
- const _: MermaidRenderer = this;
21
- if (_.withMarkdownFences) {
22
- StringBuilder__AppendLine_Z721C83C5(_.sb, "```mermaid");
23
- }
24
- StringBuilder__AppendLine_Z721C83C5(_.sb, "graph TD");
25
- }
26
- AddNode(state: ClinicalPathway_StateDefinition): void {
27
- let matchValue: ClinicalPathway_StateType_$union, patternInput: [string, FSharpList<string>], evalName: string, actionText: string, arg_14: string, actionText_1: string, outcome: string;
28
- const _: MermaidRenderer = this;
29
- const nodeId: string = sanitizeMermaidId(extractStateKeyString(state.StateKey));
30
- const stateTypeStr: string = stateTypeToString(state.StateType);
31
- StringBuilder__AppendLine_Z721C83C5(_.sb, (matchValue = state.StateType, (matchValue.tag === /* Decision */ 1) ? ((patternInput = extractDecisionDetails(matchValue.fields[0]), toText(printf(" %s{\"%s<br/>%s\"}"))(nodeId)(state.StateLabel)(patternInput[0]))) : ((matchValue.tag === /* Evaluation */ 0) ? ((evalName = extractEvaluationName(matchValue.fields[0]), toText(printf(" %s[/\"%s<br/>%s\"/]:::evaluation"))(nodeId)(state.StateLabel)(evalName))) : ((matchValue.tag === /* Action */ 2) ? ((actionText = extractActionText(matchValue.fields[0]), toText(printf(" %s[\"%s<br/>%s\"]:::action"))(nodeId)(state.StateLabel)(actionText))) : ((matchValue.tag === /* CompoundAction */ 3) ? ((arg_14 = join("<br/>", map<ClinicalPathway_ActionInfo_$union, string>(extractActionText, matchValue.fields[0])), toText(printf(" %s[\"%s<br/>%s\"]:::action"))(nodeId)(state.StateLabel)(arg_14))) : ((matchValue.tag === /* ConditionalAction */ 4) ? ((actionText_1 = extractActionText(matchValue.fields[1]), toText(printf(" %s[\"%s<br/>%s\"]:::action"))(nodeId)(state.StateLabel)(actionText_1))) : ((outcome = getTerminalOutcome(matchValue.fields[0]), toText(printf(" %s((\"%s<br/>%s\"))"))(nodeId)(state.StateLabel)(outcome)))))))));
32
- }
33
- AddEdge(transition: ClinicalPathway_TransitionDefinition, label: string): void {
34
- let sanitizedLabel: string;
35
- const _: MermaidRenderer = this;
36
- const fromId: string = sanitizeMermaidId(extractStateKeyString(transition.FromState));
37
- const toId: string = sanitizeMermaidId(extractStateKeyString(transition.ToState));
38
- StringBuilder__AppendLine_Z721C83C5(_.sb, isNullOrEmpty(label) ? toText(printf(" %s --> %s"))(fromId)(toId) : ((sanitizedLabel = sanitizeMermaidText(label), toText(printf(" %s -->|%s| %s"))(fromId)(sanitizedLabel)(toId))));
39
- }
40
- FinishGraph(metadata: { ConfidenceScore?: float64, CreatedDate: Date, ValidatedBy?: string }): string {
41
- const _: MermaidRenderer = this;
42
- StringBuilder__AppendLine_Z721C83C5(_.sb, "");
43
- StringBuilder__AppendLine_Z721C83C5(_.sb, " classDef action fill:#10b981,stroke:#059669,stroke-width:2px,color:#fff");
44
- StringBuilder__AppendLine_Z721C83C5(_.sb, " classDef conditional fill:#06b6d4,stroke:#0891b2,stroke-width:2px,color:#fff");
45
- StringBuilder__AppendLine_Z721C83C5(_.sb, " classDef evaluation fill:#9333ea,stroke:#7b1fa2,stroke-width:2px,color:#fff");
46
- StringBuilder__AppendLine_Z721C83C5(_.sb, " classDef data fill:#0284c7,stroke:#01579b,stroke-width:2px,color:#fff");
47
- StringBuilder__AppendLine_Z721C83C5(_.sb, " classDef terminal fill:#ef4444,stroke:#dc2626,stroke-width:2px,color:#fff");
48
- StringBuilder__AppendLine_Z721C83C5(_.sb, " classDef default fill:#f3f4f6,stroke:#6b7280,stroke-width:2px");
49
- if (_.withMarkdownFences) {
50
- StringBuilder__AppendLine_Z721C83C5(_.sb, "```");
51
- StringBuilder__AppendLine_Z721C83C5(_.sb, "");
52
- }
53
- return toString(_.sb);
54
- }
55
- }
56
-
57
- export function MermaidRenderer_$reflection(): TypeInfo {
58
- return class_type("F1.Studio.Renderers.MermaidRenderer.MermaidRenderer", undefined, MermaidRenderer);
59
- }
60
-
61
- export function MermaidRenderer_$ctor_Z1FBCCD16(withMarkdownFences: boolean): MermaidRenderer {
62
- return new MermaidRenderer(withMarkdownFences);
63
- }
64
-
65
- /**
66
- * Default constructor with markdown fences enabled (backward compatible)
67
- */
68
- export function MermaidRenderer_$ctor(): MermaidRenderer {
69
- return MermaidRenderer_$ctor_Z1FBCCD16(true);
70
- }
71
-
72
- export class EnhancedMermaidRenderer implements IGraphRenderer$3<void, void, string> {
73
- readonly withMarkdownFences: boolean;
74
- readonly pathway: Option<ClinicalPathway_ClinicalPathwaySpec>;
75
- readonly sb: any;
76
- addedStates: FSharpList<ClinicalPathway_StateDefinition>;
77
- addedTransitions: FSharpList<ClinicalPathway_TransitionDefinition>;
78
- constructor(pathway: Option<ClinicalPathway_ClinicalPathwaySpec>, withMarkdownFences: boolean) {
79
- this.pathway = pathway;
80
- this.withMarkdownFences = withMarkdownFences;
81
- this.sb = StringBuilder_$ctor();
82
- this.addedStates = empty<ClinicalPathway_StateDefinition>();
83
- this.addedTransitions = empty<ClinicalPathway_TransitionDefinition>();
84
- }
85
- StartGraph(pathwayName: string, version: string): void {
86
- const _: EnhancedMermaidRenderer = this;
87
- if (_.withMarkdownFences) {
88
- StringBuilder__AppendLine_Z721C83C5(_.sb, "```mermaid");
89
- }
90
- StringBuilder__AppendLine_Z721C83C5(_.sb, "graph TD");
91
- }
92
- AddNode(state: ClinicalPathway_StateDefinition): void {
93
- let matchValue: ClinicalPathway_StateType_$union, patternInput: [string, FSharpList<string>], arg_4: string, arg_5: string, evalName: string, arg_7: string, actionText: string, arg_10: string, actionTexts: FSharpList<string>, arg_13: string, arg_14: string, actionText_2: string, arg_16: string, outcome: string, arg_1: string;
94
- const _: EnhancedMermaidRenderer = this;
95
- _.addedStates = cons(state, _.addedStates);
96
- const nodeId: string = sanitizeMermaidId(extractStateKeyString(state.StateKey));
97
- const stateTypeStr: string = stateTypeToString(state.StateType);
98
- StringBuilder__AppendLine_Z721C83C5(_.sb, (matchValue = state.StateType, (matchValue.tag === /* Decision */ 1) ? ((patternInput = extractDecisionDetails(matchValue.fields[0]), (arg_4 = sanitizeMermaidText(state.StateLabel), (arg_5 = sanitizeMermaidText(patternInput[0]), toText(printf(" %s{\"%s<br/>%s\"}:::decision"))(nodeId)(arg_4)(arg_5))))) : ((matchValue.tag === /* Evaluation */ 0) ? ((evalName = sanitizeMermaidText(extractEvaluationName(matchValue.fields[0])), (arg_7 = sanitizeMermaidText(state.StateLabel), toText(printf(" %s[/\"%s<br/>%s\"/]:::evaluation"))(nodeId)(arg_7)(evalName)))) : ((matchValue.tag === /* Action */ 2) ? ((actionText = sanitizeMermaidText(extractActionText(matchValue.fields[0])), (arg_10 = sanitizeMermaidText(state.StateLabel), toText(printf(" %s[\"%s<br/>%s\"]:::action"))(nodeId)(arg_10)(actionText)))) : ((matchValue.tag === /* CompoundAction */ 3) ? ((actionTexts = mapIndexed<ClinicalPathway_ActionInfo_$union, string>((i: int32, action_1: ClinicalPathway_ActionInfo_$union): string => (`${i + 1}. ${sanitizeMermaidText(extractActionText(action_1))}`), matchValue.fields[0]), (arg_13 = sanitizeMermaidText(state.StateLabel), (arg_14 = join("<br/>", actionTexts), toText(printf(" %s[\"%s<br/>📋 Multiple Actions:<br/>%s\"]:::compound"))(nodeId)(arg_13)(arg_14))))) : ((matchValue.tag === /* ConditionalAction */ 4) ? ((actionText_2 = sanitizeMermaidText(extractActionText(matchValue.fields[1])), (arg_16 = sanitizeMermaidText(state.StateLabel), toText(printf(" %s[\"%s<br/>%s\"]:::action"))(nodeId)(arg_16)(actionText_2)))) : ((outcome = sanitizeMermaidText(getTerminalOutcome(matchValue.fields[0])), (arg_1 = sanitizeMermaidText(state.StateLabel), toText(printf(" %s((\"%s<br/>%s\"))"))(nodeId)(arg_1)(outcome))))))))));
99
- }
100
- AddEdge(transition: ClinicalPathway_TransitionDefinition, label: string): void {
101
- let sanitizedLabel: string, fullLabel: string, matchValue_1: Option<ClinicalPathway_ClinicalPathwaySpec>, p_2: ClinicalPathway_ClinicalPathwaySpec;
102
- const _: EnhancedMermaidRenderer = this;
103
- _.addedTransitions = cons(transition, _.addedTransitions);
104
- const fromId: string = sanitizeMermaidId(extractStateKeyString(transition.FromState));
105
- const toId: string = sanitizeMermaidId(extractStateKeyString(transition.ToState));
106
- let arrowStyle: string;
107
- const matchValue: Option<ClinicalPathway_ClinicalPathwaySpec> = _.pathway;
108
- arrowStyle = ((matchValue == null) ? "-->" : getTransitionArrowStyle(transition, value_23(matchValue).RequiredPaths));
109
- StringBuilder__AppendLine_Z721C83C5(_.sb, isNullOrEmpty(label) ? toText(printf(" %s %s %s"))(fromId)(arrowStyle)(toId) : ((sanitizedLabel = sanitizeMermaidText(label), (fullLabel = ((matchValue_1 = _.pathway, (matchValue_1 != null) ? (isTransitionRequired(transition, value_23(matchValue_1).RequiredPaths) ? ((p_2 = value_23(matchValue_1), `REQUIRED: ${sanitizedLabel}`)) : sanitizedLabel) : sanitizedLabel)), toText(printf(" %s %s|%s| %s"))(fromId)(arrowStyle)(fullLabel)(toId)))));
110
- }
111
- FinishGraph(metadata: { ConfidenceScore?: float64, CreatedDate: Date, ValidatedBy?: string }): string {
112
- const _: EnhancedMermaidRenderer = this;
113
- StringBuilder__AppendLine_Z721C83C5(_.sb, "");
114
- StringBuilder__AppendLine_Z721C83C5(_.sb, " classDef action fill:#10b981,stroke:#059669,stroke-width:2px,color:#fff");
115
- StringBuilder__AppendLine_Z721C83C5(_.sb, " classDef compound fill:#ff9800,stroke:#e65100,stroke-width:3px,color:#fff");
116
- StringBuilder__AppendLine_Z721C83C5(_.sb, " classDef decision fill:#f59e0b,stroke:#d97706,stroke-width:2px,color:#fff");
117
- StringBuilder__AppendLine_Z721C83C5(_.sb, " classDef evaluation fill:#9333ea,stroke:#7b1fa2,stroke-width:2px,color:#fff");
118
- StringBuilder__AppendLine_Z721C83C5(_.sb, " classDef data fill:#0284c7,stroke:#01579b,stroke-width:2px,color:#fff");
119
- StringBuilder__AppendLine_Z721C83C5(_.sb, " classDef terminal fill:#ef4444,stroke:#dc2626,stroke-width:2px,color:#fff");
120
- StringBuilder__AppendLine_Z721C83C5(_.sb, " classDef default fill:#f3f4f6,stroke:#6b7280,stroke-width:2px");
121
- const matchValue: Option<ClinicalPathway_ClinicalPathwaySpec> = _.pathway;
122
- let matchResult: int32, p_1: ClinicalPathway_ClinicalPathwaySpec;
123
- if (matchValue != null) {
124
- if (!isEmpty(value_23(matchValue).Constraints)) {
125
- matchResult = 0;
126
- p_1 = value_23(matchValue);
127
- }
128
- else {
129
- matchResult = 1;
130
- }
131
- }
132
- else {
133
- matchResult = 1;
134
- }
135
- switch (matchResult) {
136
- case 0: {
137
- StringBuilder__AppendLine_Z721C83C5(_.sb, "");
138
- StringBuilder__AppendLine_Z721C83C5(_.sb, " subgraph Constraints[\"⚠️ Safety Constraints\"]");
139
- iterateIndexed<ClinicalPathway_ConstraintDefinition>((i: int32, constr: ClinicalPathway_ConstraintDefinition): void => {
140
- StringBuilder__AppendLine_Z721C83C5(_.sb, ` C${i}["${sanitizeMermaidText(formatConstraintLabel(constr))}"]`);
141
- }, p_1!.Constraints);
142
- StringBuilder__AppendLine_Z721C83C5(_.sb, " end");
143
- break;
144
- }
145
- }
146
- const matchValue_1: Option<ClinicalPathway_ClinicalPathwaySpec> = _.pathway;
147
- let matchResult_1: int32, p_3: ClinicalPathway_ClinicalPathwaySpec;
148
- if (matchValue_1 != null) {
149
- if (!isEmpty(value_23(matchValue_1).RequiredPaths)) {
150
- matchResult_1 = 0;
151
- p_3 = value_23(matchValue_1);
152
- }
153
- else {
154
- matchResult_1 = 1;
155
- }
156
- }
157
- else {
158
- matchResult_1 = 1;
159
- }
160
- switch (matchResult_1) {
161
- case 0: {
162
- StringBuilder__AppendLine_Z721C83C5(_.sb, "");
163
- StringBuilder__AppendLine_Z721C83C5(_.sb, " subgraph RequiredPaths[\"📍 Required Pathways\"]");
164
- iterateIndexed<ClinicalPathway_PathRequirement>((i_1: int32, reqPath: ClinicalPathway_PathRequirement): void => {
165
- StringBuilder__AppendLine_Z721C83C5(_.sb, ` P${i_1}["${sanitizeMermaidText(formatRequiredPathLabel(reqPath))}"]`);
166
- }, p_3!.RequiredPaths);
167
- StringBuilder__AppendLine_Z721C83C5(_.sb, " end");
168
- break;
169
- }
170
- }
171
- const matchValue_2: Option<ClinicalPathway_ClinicalPathwaySpec> = _.pathway;
172
- let matchResult_2: int32, p_5: ClinicalPathway_ClinicalPathwaySpec;
173
- if (matchValue_2 != null) {
174
- if (exists<ClinicalPathway_PathRequirement>((_arg: ClinicalPathway_PathRequirement): boolean => true, value_23(matchValue_2).RequiredPaths)) {
175
- matchResult_2 = 0;
176
- p_5 = value_23(matchValue_2);
177
- }
178
- else {
179
- matchResult_2 = 1;
180
- }
181
- }
182
- else {
183
- matchResult_2 = 1;
184
- }
185
- switch (matchResult_2) {
186
- case 0: {
187
- StringBuilder__AppendLine_Z721C83C5(_.sb, "");
188
- StringBuilder__AppendLine_Z721C83C5(_.sb, " subgraph Legend");
189
- StringBuilder__AppendLine_Z721C83C5(_.sb, " L1[\"═══ Required Path\"]");
190
- StringBuilder__AppendLine_Z721C83C5(_.sb, " L2[\"─── Standard Path\"]");
191
- StringBuilder__AppendLine_Z721C83C5(_.sb, " end");
192
- break;
193
- }
194
- }
195
- if (_.withMarkdownFences) {
196
- StringBuilder__AppendLine_Z721C83C5(_.sb, "```");
197
- StringBuilder__AppendLine_Z721C83C5(_.sb, "");
198
- }
199
- return toString(_.sb);
200
- }
201
- }
202
-
203
- export function EnhancedMermaidRenderer_$reflection(): TypeInfo {
204
- return class_type("F1.Studio.Renderers.MermaidRenderer.EnhancedMermaidRenderer", undefined, EnhancedMermaidRenderer);
205
- }
206
-
207
- export function EnhancedMermaidRenderer_$ctor_2CF73600(pathway: Option<ClinicalPathway_ClinicalPathwaySpec>, withMarkdownFences: boolean): EnhancedMermaidRenderer {
208
- return new EnhancedMermaidRenderer(pathway, withMarkdownFences);
209
- }
210
-
211
- /**
212
- * Default constructor with markdown fences enabled (backward compatible)
213
- */
214
- export function EnhancedMermaidRenderer_$ctor_Z18DF056(pathway: Option<ClinicalPathway_ClinicalPathwaySpec>): EnhancedMermaidRenderer {
215
- return EnhancedMermaidRenderer_$ctor_2CF73600(pathway, true);
216
- }
217
-
218
- //# sourceMappingURL=MermaidRenderer.ts.map
1
+ import { StringBuilder_$ctor, StringBuilder__AppendLine_Z721C83C5 } from "@fable-org/fable-library-js/System.Text.js";
2
+ import { sanitizeMermaidText, getTerminalOutcome, extractActionText, extractEvaluationName, extractDecisionDetails, stateTypeToString, extractStateKeyString, sanitizeMermaidId } from "../PathwayDataExtractor.js";
3
+ import { isNullOrEmpty, join, printf, toText } from "@fable-org/fable-library-js/String.js";
4
+ import { empty, exists, isEmpty, iterateIndexed, mapIndexed, cons, FSharpList, map } from "@fable-org/fable-library-js/List.js";
5
+ import { ClinicalPathway_PathRequirement, ClinicalPathway_ConstraintDefinition, ClinicalPathway_ClinicalPathwaySpec, ClinicalPathway_TransitionDefinition, ClinicalPathway_StateType_$union, ClinicalPathway_StateDefinition, ClinicalPathway_ActionInfo_$union } from "../FormSpec.js";
6
+ import { toString } from "@fable-org/fable-library-js/Types.js";
7
+ import { int32, float64 } from "@fable-org/fable-library-js/Int32.js";
8
+ import { formatRequiredPathLabel, formatConstraintLabel, isTransitionRequired, getTransitionArrowStyle, IGraphRenderer$3 } from "./PathwayRenderers.js";
9
+ import { class_type, TypeInfo } from "@fable-org/fable-library-js/Reflection.js";
10
+ import { value as value_23, Option } from "@fable-org/fable-library-js/Option.js";
11
+
12
+ export class MermaidRenderer implements IGraphRenderer$3<void, void, string> {
13
+ readonly withMarkdownFences: boolean;
14
+ readonly sb: any;
15
+ constructor(withMarkdownFences: boolean) {
16
+ this.withMarkdownFences = withMarkdownFences;
17
+ this.sb = StringBuilder_$ctor();
18
+ }
19
+ StartGraph(pathwayName: string, version: string): void {
20
+ const _: MermaidRenderer = this;
21
+ if (_.withMarkdownFences) {
22
+ StringBuilder__AppendLine_Z721C83C5(_.sb, "```mermaid");
23
+ }
24
+ StringBuilder__AppendLine_Z721C83C5(_.sb, "graph TD");
25
+ }
26
+ AddNode(state: ClinicalPathway_StateDefinition): void {
27
+ let matchValue: ClinicalPathway_StateType_$union, patternInput: [string, FSharpList<string>], evalName: string, actionText: string, arg_14: string, actionText_1: string, outcome: string;
28
+ const _: MermaidRenderer = this;
29
+ const nodeId: string = sanitizeMermaidId(extractStateKeyString(state.StateKey));
30
+ const stateTypeStr: string = stateTypeToString(state.StateType);
31
+ StringBuilder__AppendLine_Z721C83C5(_.sb, (matchValue = state.StateType, (matchValue.tag === /* Decision */ 1) ? ((patternInput = extractDecisionDetails(matchValue.fields[0]), toText(printf(" %s{\"%s<br/>%s\"}"))(nodeId)(state.StateLabel)(patternInput[0]))) : ((matchValue.tag === /* Evaluation */ 0) ? ((evalName = extractEvaluationName(matchValue.fields[0]), toText(printf(" %s[/\"%s<br/>%s\"/]:::evaluation"))(nodeId)(state.StateLabel)(evalName))) : ((matchValue.tag === /* Action */ 2) ? ((actionText = extractActionText(matchValue.fields[0]), toText(printf(" %s[\"%s<br/>%s\"]:::action"))(nodeId)(state.StateLabel)(actionText))) : ((matchValue.tag === /* CompoundAction */ 3) ? ((arg_14 = join("<br/>", map<ClinicalPathway_ActionInfo_$union, string>(extractActionText, matchValue.fields[0])), toText(printf(" %s[\"%s<br/>%s\"]:::action"))(nodeId)(state.StateLabel)(arg_14))) : ((matchValue.tag === /* ConditionalAction */ 4) ? ((actionText_1 = extractActionText(matchValue.fields[1]), toText(printf(" %s[\"%s<br/>%s\"]:::action"))(nodeId)(state.StateLabel)(actionText_1))) : ((outcome = getTerminalOutcome(matchValue.fields[0]), toText(printf(" %s((\"%s<br/>%s\"))"))(nodeId)(state.StateLabel)(outcome)))))))));
32
+ }
33
+ AddEdge(transition: ClinicalPathway_TransitionDefinition, label: string): void {
34
+ let sanitizedLabel: string;
35
+ const _: MermaidRenderer = this;
36
+ const fromId: string = sanitizeMermaidId(extractStateKeyString(transition.FromState));
37
+ const toId: string = sanitizeMermaidId(extractStateKeyString(transition.ToState));
38
+ StringBuilder__AppendLine_Z721C83C5(_.sb, isNullOrEmpty(label) ? toText(printf(" %s --> %s"))(fromId)(toId) : ((sanitizedLabel = sanitizeMermaidText(label), toText(printf(" %s -->|%s| %s"))(fromId)(sanitizedLabel)(toId))));
39
+ }
40
+ FinishGraph(metadata: { ConfidenceScore?: float64, CreatedDate: Date, ValidatedBy?: string }): string {
41
+ const _: MermaidRenderer = this;
42
+ StringBuilder__AppendLine_Z721C83C5(_.sb, "");
43
+ StringBuilder__AppendLine_Z721C83C5(_.sb, " classDef action fill:#10b981,stroke:#059669,stroke-width:2px,color:#fff");
44
+ StringBuilder__AppendLine_Z721C83C5(_.sb, " classDef conditional fill:#06b6d4,stroke:#0891b2,stroke-width:2px,color:#fff");
45
+ StringBuilder__AppendLine_Z721C83C5(_.sb, " classDef evaluation fill:#9333ea,stroke:#7b1fa2,stroke-width:2px,color:#fff");
46
+ StringBuilder__AppendLine_Z721C83C5(_.sb, " classDef data fill:#0284c7,stroke:#01579b,stroke-width:2px,color:#fff");
47
+ StringBuilder__AppendLine_Z721C83C5(_.sb, " classDef terminal fill:#ef4444,stroke:#dc2626,stroke-width:2px,color:#fff");
48
+ StringBuilder__AppendLine_Z721C83C5(_.sb, " classDef default fill:#f3f4f6,stroke:#6b7280,stroke-width:2px");
49
+ if (_.withMarkdownFences) {
50
+ StringBuilder__AppendLine_Z721C83C5(_.sb, "```");
51
+ StringBuilder__AppendLine_Z721C83C5(_.sb, "");
52
+ }
53
+ return toString(_.sb);
54
+ }
55
+ }
56
+
57
+ export function MermaidRenderer_$reflection(): TypeInfo {
58
+ return class_type("F1.Studio.Renderers.MermaidRenderer.MermaidRenderer", undefined, MermaidRenderer);
59
+ }
60
+
61
+ export function MermaidRenderer_$ctor_Z1FBCCD16(withMarkdownFences: boolean): MermaidRenderer {
62
+ return new MermaidRenderer(withMarkdownFences);
63
+ }
64
+
65
+ /**
66
+ * Default constructor with markdown fences enabled (backward compatible)
67
+ */
68
+ export function MermaidRenderer_$ctor(): MermaidRenderer {
69
+ return MermaidRenderer_$ctor_Z1FBCCD16(true);
70
+ }
71
+
72
+ export class EnhancedMermaidRenderer implements IGraphRenderer$3<void, void, string> {
73
+ readonly withMarkdownFences: boolean;
74
+ readonly pathway: Option<ClinicalPathway_ClinicalPathwaySpec>;
75
+ readonly sb: any;
76
+ addedStates: FSharpList<ClinicalPathway_StateDefinition>;
77
+ addedTransitions: FSharpList<ClinicalPathway_TransitionDefinition>;
78
+ constructor(pathway: Option<ClinicalPathway_ClinicalPathwaySpec>, withMarkdownFences: boolean) {
79
+ this.pathway = pathway;
80
+ this.withMarkdownFences = withMarkdownFences;
81
+ this.sb = StringBuilder_$ctor();
82
+ this.addedStates = empty<ClinicalPathway_StateDefinition>();
83
+ this.addedTransitions = empty<ClinicalPathway_TransitionDefinition>();
84
+ }
85
+ StartGraph(pathwayName: string, version: string): void {
86
+ const _: EnhancedMermaidRenderer = this;
87
+ if (_.withMarkdownFences) {
88
+ StringBuilder__AppendLine_Z721C83C5(_.sb, "```mermaid");
89
+ }
90
+ StringBuilder__AppendLine_Z721C83C5(_.sb, "graph TD");
91
+ }
92
+ AddNode(state: ClinicalPathway_StateDefinition): void {
93
+ let matchValue: ClinicalPathway_StateType_$union, patternInput: [string, FSharpList<string>], arg_4: string, arg_5: string, evalName: string, arg_7: string, actionText: string, arg_10: string, actionTexts: FSharpList<string>, arg_13: string, arg_14: string, actionText_2: string, arg_16: string, outcome: string, arg_1: string;
94
+ const _: EnhancedMermaidRenderer = this;
95
+ _.addedStates = cons(state, _.addedStates);
96
+ const nodeId: string = sanitizeMermaidId(extractStateKeyString(state.StateKey));
97
+ const stateTypeStr: string = stateTypeToString(state.StateType);
98
+ StringBuilder__AppendLine_Z721C83C5(_.sb, (matchValue = state.StateType, (matchValue.tag === /* Decision */ 1) ? ((patternInput = extractDecisionDetails(matchValue.fields[0]), (arg_4 = sanitizeMermaidText(state.StateLabel), (arg_5 = sanitizeMermaidText(patternInput[0]), toText(printf(" %s{\"%s<br/>%s\"}:::decision"))(nodeId)(arg_4)(arg_5))))) : ((matchValue.tag === /* Evaluation */ 0) ? ((evalName = sanitizeMermaidText(extractEvaluationName(matchValue.fields[0])), (arg_7 = sanitizeMermaidText(state.StateLabel), toText(printf(" %s[/\"%s<br/>%s\"/]:::evaluation"))(nodeId)(arg_7)(evalName)))) : ((matchValue.tag === /* Action */ 2) ? ((actionText = sanitizeMermaidText(extractActionText(matchValue.fields[0])), (arg_10 = sanitizeMermaidText(state.StateLabel), toText(printf(" %s[\"%s<br/>%s\"]:::action"))(nodeId)(arg_10)(actionText)))) : ((matchValue.tag === /* CompoundAction */ 3) ? ((actionTexts = mapIndexed<ClinicalPathway_ActionInfo_$union, string>((i: int32, action_1: ClinicalPathway_ActionInfo_$union): string => (`${i + 1}. ${sanitizeMermaidText(extractActionText(action_1))}`), matchValue.fields[0]), (arg_13 = sanitizeMermaidText(state.StateLabel), (arg_14 = join("<br/>", actionTexts), toText(printf(" %s[\"%s<br/>📋 Multiple Actions:<br/>%s\"]:::compound"))(nodeId)(arg_13)(arg_14))))) : ((matchValue.tag === /* ConditionalAction */ 4) ? ((actionText_2 = sanitizeMermaidText(extractActionText(matchValue.fields[1])), (arg_16 = sanitizeMermaidText(state.StateLabel), toText(printf(" %s[\"%s<br/>%s\"]:::action"))(nodeId)(arg_16)(actionText_2)))) : ((outcome = sanitizeMermaidText(getTerminalOutcome(matchValue.fields[0])), (arg_1 = sanitizeMermaidText(state.StateLabel), toText(printf(" %s((\"%s<br/>%s\"))"))(nodeId)(arg_1)(outcome))))))))));
99
+ }
100
+ AddEdge(transition: ClinicalPathway_TransitionDefinition, label: string): void {
101
+ let sanitizedLabel: string, fullLabel: string, matchValue_1: Option<ClinicalPathway_ClinicalPathwaySpec>, p_2: ClinicalPathway_ClinicalPathwaySpec;
102
+ const _: EnhancedMermaidRenderer = this;
103
+ _.addedTransitions = cons(transition, _.addedTransitions);
104
+ const fromId: string = sanitizeMermaidId(extractStateKeyString(transition.FromState));
105
+ const toId: string = sanitizeMermaidId(extractStateKeyString(transition.ToState));
106
+ let arrowStyle: string;
107
+ const matchValue: Option<ClinicalPathway_ClinicalPathwaySpec> = _.pathway;
108
+ arrowStyle = ((matchValue == null) ? "-->" : getTransitionArrowStyle(transition, value_23(matchValue).RequiredPaths));
109
+ StringBuilder__AppendLine_Z721C83C5(_.sb, isNullOrEmpty(label) ? toText(printf(" %s %s %s"))(fromId)(arrowStyle)(toId) : ((sanitizedLabel = sanitizeMermaidText(label), (fullLabel = ((matchValue_1 = _.pathway, (matchValue_1 != null) ? (isTransitionRequired(transition, value_23(matchValue_1).RequiredPaths) ? ((p_2 = value_23(matchValue_1), `REQUIRED: ${sanitizedLabel}`)) : sanitizedLabel) : sanitizedLabel)), toText(printf(" %s %s|%s| %s"))(fromId)(arrowStyle)(fullLabel)(toId)))));
110
+ }
111
+ FinishGraph(metadata: { ConfidenceScore?: float64, CreatedDate: Date, ValidatedBy?: string }): string {
112
+ const _: EnhancedMermaidRenderer = this;
113
+ StringBuilder__AppendLine_Z721C83C5(_.sb, "");
114
+ StringBuilder__AppendLine_Z721C83C5(_.sb, " classDef action fill:#10b981,stroke:#059669,stroke-width:2px,color:#fff");
115
+ StringBuilder__AppendLine_Z721C83C5(_.sb, " classDef compound fill:#ff9800,stroke:#e65100,stroke-width:3px,color:#fff");
116
+ StringBuilder__AppendLine_Z721C83C5(_.sb, " classDef decision fill:#f59e0b,stroke:#d97706,stroke-width:2px,color:#fff");
117
+ StringBuilder__AppendLine_Z721C83C5(_.sb, " classDef evaluation fill:#9333ea,stroke:#7b1fa2,stroke-width:2px,color:#fff");
118
+ StringBuilder__AppendLine_Z721C83C5(_.sb, " classDef data fill:#0284c7,stroke:#01579b,stroke-width:2px,color:#fff");
119
+ StringBuilder__AppendLine_Z721C83C5(_.sb, " classDef terminal fill:#ef4444,stroke:#dc2626,stroke-width:2px,color:#fff");
120
+ StringBuilder__AppendLine_Z721C83C5(_.sb, " classDef default fill:#f3f4f6,stroke:#6b7280,stroke-width:2px");
121
+ const matchValue: Option<ClinicalPathway_ClinicalPathwaySpec> = _.pathway;
122
+ let matchResult: int32, p_1: ClinicalPathway_ClinicalPathwaySpec;
123
+ if (matchValue != null) {
124
+ if (!isEmpty(value_23(matchValue).Constraints)) {
125
+ matchResult = 0;
126
+ p_1 = value_23(matchValue);
127
+ }
128
+ else {
129
+ matchResult = 1;
130
+ }
131
+ }
132
+ else {
133
+ matchResult = 1;
134
+ }
135
+ switch (matchResult) {
136
+ case 0: {
137
+ StringBuilder__AppendLine_Z721C83C5(_.sb, "");
138
+ StringBuilder__AppendLine_Z721C83C5(_.sb, " subgraph Constraints[\"⚠️ Safety Constraints\"]");
139
+ iterateIndexed<ClinicalPathway_ConstraintDefinition>((i: int32, constr: ClinicalPathway_ConstraintDefinition): void => {
140
+ StringBuilder__AppendLine_Z721C83C5(_.sb, ` C${i}["${sanitizeMermaidText(formatConstraintLabel(constr))}"]`);
141
+ }, p_1!.Constraints);
142
+ StringBuilder__AppendLine_Z721C83C5(_.sb, " end");
143
+ break;
144
+ }
145
+ }
146
+ const matchValue_1: Option<ClinicalPathway_ClinicalPathwaySpec> = _.pathway;
147
+ let matchResult_1: int32, p_3: ClinicalPathway_ClinicalPathwaySpec;
148
+ if (matchValue_1 != null) {
149
+ if (!isEmpty(value_23(matchValue_1).RequiredPaths)) {
150
+ matchResult_1 = 0;
151
+ p_3 = value_23(matchValue_1);
152
+ }
153
+ else {
154
+ matchResult_1 = 1;
155
+ }
156
+ }
157
+ else {
158
+ matchResult_1 = 1;
159
+ }
160
+ switch (matchResult_1) {
161
+ case 0: {
162
+ StringBuilder__AppendLine_Z721C83C5(_.sb, "");
163
+ StringBuilder__AppendLine_Z721C83C5(_.sb, " subgraph RequiredPaths[\"📍 Required Pathways\"]");
164
+ iterateIndexed<ClinicalPathway_PathRequirement>((i_1: int32, reqPath: ClinicalPathway_PathRequirement): void => {
165
+ StringBuilder__AppendLine_Z721C83C5(_.sb, ` P${i_1}["${sanitizeMermaidText(formatRequiredPathLabel(reqPath))}"]`);
166
+ }, p_3!.RequiredPaths);
167
+ StringBuilder__AppendLine_Z721C83C5(_.sb, " end");
168
+ break;
169
+ }
170
+ }
171
+ const matchValue_2: Option<ClinicalPathway_ClinicalPathwaySpec> = _.pathway;
172
+ let matchResult_2: int32, p_5: ClinicalPathway_ClinicalPathwaySpec;
173
+ if (matchValue_2 != null) {
174
+ if (exists<ClinicalPathway_PathRequirement>((_arg: ClinicalPathway_PathRequirement): boolean => true, value_23(matchValue_2).RequiredPaths)) {
175
+ matchResult_2 = 0;
176
+ p_5 = value_23(matchValue_2);
177
+ }
178
+ else {
179
+ matchResult_2 = 1;
180
+ }
181
+ }
182
+ else {
183
+ matchResult_2 = 1;
184
+ }
185
+ switch (matchResult_2) {
186
+ case 0: {
187
+ StringBuilder__AppendLine_Z721C83C5(_.sb, "");
188
+ StringBuilder__AppendLine_Z721C83C5(_.sb, " subgraph Legend");
189
+ StringBuilder__AppendLine_Z721C83C5(_.sb, " L1[\"═══ Required Path\"]");
190
+ StringBuilder__AppendLine_Z721C83C5(_.sb, " L2[\"─── Standard Path\"]");
191
+ StringBuilder__AppendLine_Z721C83C5(_.sb, " end");
192
+ break;
193
+ }
194
+ }
195
+ if (_.withMarkdownFences) {
196
+ StringBuilder__AppendLine_Z721C83C5(_.sb, "```");
197
+ StringBuilder__AppendLine_Z721C83C5(_.sb, "");
198
+ }
199
+ return toString(_.sb);
200
+ }
201
+ }
202
+
203
+ export function EnhancedMermaidRenderer_$reflection(): TypeInfo {
204
+ return class_type("F1.Studio.Renderers.MermaidRenderer.EnhancedMermaidRenderer", undefined, EnhancedMermaidRenderer);
205
+ }
206
+
207
+ export function EnhancedMermaidRenderer_$ctor_2CF73600(pathway: Option<ClinicalPathway_ClinicalPathwaySpec>, withMarkdownFences: boolean): EnhancedMermaidRenderer {
208
+ return new EnhancedMermaidRenderer(pathway, withMarkdownFences);
209
+ }
210
+
211
+ /**
212
+ * Default constructor with markdown fences enabled (backward compatible)
213
+ */
214
+ export function EnhancedMermaidRenderer_$ctor_Z18DF056(pathway: Option<ClinicalPathway_ClinicalPathwaySpec>): EnhancedMermaidRenderer {
215
+ return EnhancedMermaidRenderer_$ctor_2CF73600(pathway, true);
216
+ }
217
+
218
+ //# sourceMappingURL=MermaidRenderer.ts.map