agentic-mermaid 0.3.0 → 0.3.1

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 (71) hide show
  1. package/CHANGELOG.md +14 -0
  2. package/dist/agent-core.d.ts +8 -3
  3. package/dist/agent-core.js +2 -2
  4. package/dist/agent.d.ts +2 -2
  5. package/dist/agent.js +4 -4
  6. package/dist/agentic-mermaid-mcp.js +5 -5
  7. package/dist/am.js +6 -6
  8. package/dist/browser-lazy/chunks/architecture-3CGEU363.js +31 -0
  9. package/dist/browser-lazy/chunks/chunk-2U4EUPSI.js +4 -0
  10. package/dist/browser-lazy/chunks/chunk-4IUBLBJJ.js +11 -0
  11. package/dist/browser-lazy/chunks/chunk-4U2TVB2S.js +1 -0
  12. package/dist/browser-lazy/chunks/chunk-5Q4S74UO.js +1 -0
  13. package/dist/browser-lazy/chunks/chunk-6UT2VTFI.js +1 -0
  14. package/dist/browser-lazy/chunks/chunk-7D24ZLOV.js +1 -0
  15. package/dist/browser-lazy/chunks/chunk-A7L4WWVW.js +143 -0
  16. package/dist/browser-lazy/chunks/chunk-CTVVJPMX.js +24 -0
  17. package/dist/browser-lazy/chunks/chunk-DPSSG7LR.js +4 -0
  18. package/dist/browser-lazy/chunks/chunk-EPFMQPXX.js +1 -0
  19. package/dist/browser-lazy/chunks/chunk-FFOHLPDA.js +2 -0
  20. package/dist/browser-lazy/chunks/chunk-FLD63DXE.js +2 -0
  21. package/dist/browser-lazy/chunks/chunk-FXBBGAMJ.js +46 -0
  22. package/dist/browser-lazy/chunks/chunk-GRXCKTHX.js +0 -0
  23. package/dist/browser-lazy/chunks/chunk-HZ4ADQMK.js +1 -0
  24. package/dist/browser-lazy/chunks/chunk-I6VE56S7.js +1 -0
  25. package/dist/browser-lazy/chunks/chunk-JX5ZZY3T.js +1 -0
  26. package/dist/browser-lazy/chunks/chunk-KJVNXJ5Y.js +1 -0
  27. package/dist/browser-lazy/chunks/chunk-KTTWXSIX.js +1 -0
  28. package/dist/browser-lazy/chunks/chunk-M6BT2HIP.js +1 -0
  29. package/dist/browser-lazy/chunks/chunk-MMWVZP6M.js +1 -0
  30. package/dist/browser-lazy/chunks/chunk-OFRMKQA6.js +1 -0
  31. package/dist/browser-lazy/chunks/chunk-P7HMSKHJ.js +1 -0
  32. package/dist/browser-lazy/chunks/chunk-PXRUFH7U.js +1 -0
  33. package/dist/browser-lazy/chunks/chunk-PZEWZT35.js +1 -0
  34. package/dist/browser-lazy/chunks/chunk-RVO6J7S3.js +1 -0
  35. package/dist/browser-lazy/chunks/chunk-STQRDZ67.js +1 -0
  36. package/dist/browser-lazy/chunks/chunk-T7IJ6V4B.js +3 -0
  37. package/dist/browser-lazy/chunks/chunk-VDTSULBU.js +7 -0
  38. package/dist/browser-lazy/chunks/chunk-WEUWIFG3.js +1 -0
  39. package/dist/browser-lazy/chunks/class-B3AVLSIF.js +9 -0
  40. package/dist/browser-lazy/chunks/er-AF4BKKKC.js +9 -0
  41. package/dist/browser-lazy/chunks/flowchart-BE6BQZLZ.js +4 -0
  42. package/dist/browser-lazy/chunks/gantt-U4BMMSEL.js +28 -0
  43. package/dist/browser-lazy/chunks/gitgraph-UPSWNFRP.js +8 -0
  44. package/dist/browser-lazy/chunks/journey-PDZ7FDJR.js +40 -0
  45. package/dist/browser-lazy/chunks/mindmap-BFEUURLS.js +9 -0
  46. package/dist/browser-lazy/chunks/pie-ZFYW5JZO.js +19 -0
  47. package/dist/browser-lazy/chunks/quadrant-XJVEYYXK.js +24 -0
  48. package/dist/browser-lazy/chunks/radar-OVXFNRNC.js +32 -0
  49. package/dist/browser-lazy/chunks/render-core-R4ZGGEFS.js +12 -0
  50. package/dist/browser-lazy/chunks/sequence-AWY6JCSB.js +12 -0
  51. package/dist/browser-lazy/chunks/state-TCE4DXKR.js +4 -0
  52. package/dist/browser-lazy/chunks/timeline-W4ZVT3FF.js +20 -0
  53. package/dist/browser-lazy/chunks/xychart-K3QQACKS.js +36 -0
  54. package/dist/browser-lazy/index.d.ts +1012 -0
  55. package/dist/browser-lazy/index.js +1 -0
  56. package/dist/browser.global.js +322 -321
  57. package/dist/{chunk-AVCWKYII.js → chunk-BSVM3VMO.js} +18 -5
  58. package/dist/{chunk-HFD4MALA.js → chunk-FGO3J7RA.js} +7 -7
  59. package/dist/{chunk-UJNY65QS.js → chunk-JJ7JRYZV.js} +2 -2
  60. package/dist/{chunk-3QCXO4V6.js → chunk-KQMJ37OY.js} +4 -4
  61. package/dist/{chunk-GILQUGFK.js → chunk-MBIR6S3B.js} +2 -2
  62. package/dist/{chunk-WHYJLDYG.js → chunk-XVY324NY.js} +47736 -47665
  63. package/dist/{index-CLwYn6Im.d.ts → index-Do8z5rPq.d.ts} +5409 -5391
  64. package/dist/index.d.ts +1 -1
  65. package/dist/index.js +1 -1
  66. package/dist/mcp-cli-7FLGTEG3.js +17 -0
  67. package/docs/README.md +1 -1
  68. package/docs/browser.md +355 -47
  69. package/package.json +13 -3
  70. package/server.json +2 -2
  71. package/dist/mcp-cli-SJVOGRA6.js +0 -17
package/CHANGELOG.md CHANGED
@@ -4,6 +4,20 @@ This changelog tracks user-facing changes for **Agentic Mermaid**, a fork of `lu
4
4
 
5
5
  ## Unreleased
6
6
 
7
+ ## 0.3.1 — 2026-07-27
8
+
9
+ ### Added
10
+ - Added the framework-neutral `agentic-mermaid/browser/lazy` ESM entry with async, per-built-in-family SVG loading, shared on-demand ELK, exact all-family parity tests, and raw/gzip/Brotli/request-count build budgets.
11
+
12
+ ### Changed
13
+ - Migrated the live `/demo/` page from the classic all-family bundle to the published lazy module graph. Its Timeline renderer path drops from 895,155 to 162,026 gzip bytes while retaining the classic compatibility artifact for synchronous script-tag consumers.
14
+
15
+ ### Fixed
16
+ - Kept direct Flowchart/State compatibility-parser imports independent of complete family-registry initialization after the lazy-browser split. The registry and compatibility parser now share one lightweight header authority whose generated browser detectors remain self-contained, and a fresh-process regression prevents aggregate test import order from hiding an uninstalled resolver.
17
+ - Made the Firefox/WebKit compatibility-bundle smoke contract load the shipped artifact through a real loopback `<script src>` request. This exercises the documented consumer path and avoids hanging WebKit by transferring the multi-megabyte bundle through Playwright's script-injection control channel.
18
+ - Made parsed wrapper and family-body ownership disjoint and byte-exact, including empty, CRLF, and standalone-BOM wrappers, so replacing an extension descriptor cannot duplicate leading comments, frontmatter, init directives, or blank lines. Structured built-in and extension serializers now also retain universal init config authored after the family header, while the shared envelope reads serializer output through the same directive grammar and avoids duplicating config it already owns — including when a source-preserving serializer re-indents, re-spaces, or reorders object keys in the directive it preserved. Canonical serialization folds every parseable directive into the final effective config in authored order, so partial nested overrides and whole-object replacements cannot reinstate stale values or make output non-idempotent. Mutation refreshes wrapper metadata and spans from the rebuilt artifact while retaining prior dropped-comment loss receipts, whose `line` continues to index the artifact the loss happened in.
19
+ - Made MCP Registry publication retry-safe after an ambiguous publish result. The release workflow now checks the immutable exact-version endpoint, accepts an existing version only when its publisher-owned server metadata is structurally identical to the verified artifact and the Registry's mutable official status is `active`, and fails closed on mismatches, inactive records, and malformed responses. A Registry that is unreachable or answering unexpectedly is retried over a bounded backoff before failing closed, so a transient outage cannot block an otherwise-publishable release.
20
+
7
21
  ## 0.3.0 — 2026-07-25
8
22
 
9
23
  ### Added
@@ -1,5 +1,5 @@
1
- import { P as ParsedDiagram, d7 as Result, cl as ParseError, es as ValidDiagramPayload, eq as ValidDiagram, aP as ExtensionDiagramBody, c5 as MutationError, fV as Direction, bv as FlowchartMutationOp, bw as FlowchartValidDiagram, dP as StateMutationOp, dS as StateValidDiagram, dE as SequenceMutationOp, dG as SequenceValidDiagram, ee as TimelineMutationOp, eh as TimelineValidDiagram, a7 as ClassMutationOp, ac as ClassValidDiagram, aL as ErMutationOp, aN as ErValidDiagram, bM as JourneyMutationOp, bP as JourneyValidDiagram, n as ArchitectureMutationOp, q as ArchitectureValidDiagram, eD as XyChartMutationOp, eF as XyChartValidDiagram, co as PieMutationOp, cq as PieValidDiagram, cJ as QuadrantMutationOp, cL as QuadrantValidDiagram, bB as GanttMutationOp, bE as GanttValidDiagram, c2 as MindmapMutationOp, c3 as MindmapValidDiagram, bG as GitGraphMutationOp, bH as GitGraphValidDiagram, cV as RadarMutationOp, cW as RadarValidDiagram, aA as DiagramKind, f as AnyMutationOp, c4 as MutableValidDiagram, fW as MermaidEdge, eu as VerifyResult, et as VerifyOptions, d0 as RenderedLayout, bQ as LayoutRouteCertificate, bd as FamilyConformanceReport, bf as FamilyDescriptor, bi as FamilyId, fX as PositionedDiagram, bm as FamilyPositionedProjectionOptions, bn as FamilyPositionedView, d4 as RenderedRegionKind, fY as TerminalProjectionDiagnosticCode, D as DiagramActionRecord, A as AsciiRenderOptions, ay as DiagramAnalysis, R as RenderOptions, b as RenderRequestReceipt, fZ as renderMermaidASCII$1, c$ as RenderedAscii, f_ as renderMermaidSVG$1, f$ as RenderedSvg } from './index-CLwYn6Im.js';
2
- export { e as Accessibility, g as AnyPort, h as ArchitectureBody, i as ArchitectureEdge, j as ArchitectureEndpoint, k as ArchitectureEndpointBoundary, l as ArchitectureGroup, m as ArchitectureJunction, o as ArchitectureService, p as ArchitectureSide, r as ArchitectureVisualOverrides, s as AsciiRenderColorMode, t as AsciiWidthError, u as AsciiWidthErrorReason, B as BACKEND_CONFORMANCE_CHECK_IDS, v as BACKEND_CONFORMANCE_FIXTURE_ID, w as BACKEND_CONFORMANCE_VERSION, x as BINDABLE_ROLE_STYLE_PROPERTIES, y as BINDABLE_SCENE_ROLES, z as BRAND_CONSTRAINT_DESCRIPTORS, C as BRAND_CONSTRAINT_KINDS, E as BUILTIN_FAMILY_METADATA, F as BUILTIN_FAMILY_METADATA_COVERS_DIAGRAM_KIND, G as BUILTIN_SCENE_ROLE_TRAITS, I as BackendCapabilityConformanceResult, J as BackendCapabilityConformanceStatus, K as BackendConformanceCheck, L as BackendConformanceCheckId, M as BackendConformanceReport, N as BackendDescriptor, O as BackendRegistrationOptions, Q as BindableSceneRole, S as BrandConstraint, T as BrandConstraintAction, U as BrandConstraintKind, V as BuiltinFamilyId, W as BuiltinFamilyMetadata, X as CAPABILITY_NEGOTIATION_VERSION, Y as CORE_CAPABILITY_OFFERS, Z as CORE_SCENE_FEATURES, _ as CORE_SCENE_OPERATIONS, $ as CORE_SCENE_PRIMITIVES, a0 as CapabilityDecision, a1 as CapabilityId, a2 as CapabilityOffer, a3 as CapabilityRequirement, a4 as CapabilityRequirementLevel, a5 as CapabilityResolution, a6 as ClassBody, a8 as ClassNode, a9 as ClassNote, aa as ClassRelation, ab as ClassRelationKind, ad as CliRenderTransport, ae as CodeModeRenderTransport, af as ConnectorContourSemantics, ag as ConnectorEndpoints, ah as ConnectorGeometry, ai as ConnectorHitGeometry, aj as ConnectorLabelDescriptor, ak as ConnectorMark, al as ConnectorRelationship, am as ConnectorRoute, an as ConnectorStroke, ao as ConnectorSubpath, ap as ConnectorTerminalLabelProjection, aq as ConnectorTerminalMarkerPlacement, ar as ConnectorTerminalMarkerProjection, as as ConnectorTerminalProjection, at as ConnectorTerminalStrokeLoss, au as DEFAULT_LABEL_CHAR_CAP, av as DefaultBackend, aw as DiagramActionKind, ax as DiagramActionSecurity, az as DiagramBody, aB as DiamondFacet, aC as EXACT_ROLE_STYLE_CONTRACT, aD as EXACT_STYLE_SCENE_ROLES, aE as EXTERNAL_SCENE_API_VERSION, aF as EdgeId, aG as EdgeRouteCertificate, aH as ErAttribute, aI as ErBody, aJ as ErCardinality, aK as ErEntity, aM as ErRelation, aO as ExactStyleSceneRole, aQ as ExtensionIdentity, aR as ExtensionValidDiagram, aS as ExternalFamilyId, aT as ExternalSceneConnector, aU as ExternalSceneConnectorGeometry, aV as ExternalSceneConnectorLabel, aW as ExternalSceneContainer, aX as ExternalSceneDataMark, aY as ExternalSceneDocument, aZ as ExternalSceneGeometry, a_ as ExternalSceneInput, a$ as ExternalSceneMarker, b0 as ExternalSceneNode, b1 as ExternalSceneNodeBase, b2 as ExternalSceneShape, b3 as ExternalSceneText, b4 as ExtractedLabel, b5 as FAMILY_CAPABILITY_COLUMNS, b6 as FAMILY_CONFORMANCE_MAX_EXAMPLE_BYTES, b7 as FAMILY_CONFORMANCE_VERSION, b8 as FAMILY_DESCRIPTOR_CONTRACT_VERSION, b9 as FamilyCapability, ba as FamilyCapabilityConformanceResult, bb as FamilyCapabilityEvidence, bc as FamilyCapabilityState, be as FamilyConformanceStatus, bg as FamilyDetectionDiagnostic, bh as FamilyEdgeRouteCertificate, bj as FamilyOperations, bk as FamilyParsedBody, bl as FamilyPositionedProjectionContext, bo as FamilyRouteCertificate, bp as FamilyScenePositivePrimitive, bq as FamilyScenePrimitiveApplicability, br as FamilyScenePrimitiveEvidence, bs as FamilySceneRolePrimitiveDeclaration, bt as FeedbackEdgeAnalysis, bu as Finite, bx as GanttBody, by as GanttBodySection, bz as GanttBodyTask, bA as GanttBodyTaskTag, bC as GanttScheduleAnalysisSummary, bD as GanttStatement, bF as GitGraphBody, bI as GroupId, bJ as HOSTED_FONT_RESOURCES, H as HostBackendPolicy, bK as InitDirective, bL as JourneyBody, bN as JourneySection, bO as JourneyTask, bR as LayoutRouteClass, bS as LayoutWarning, bT as LibraryRenderTransport, bU as MAX_HOSTED_PNG_BYTES, bV as MAX_HOSTED_PNG_PIXELS, bW as MAX_PNG_FONT_DIRECTORIES, bX as MAX_PNG_FONT_DIRECTORY_LENGTH, bY as MAX_PNG_PIXELS, bZ as MAX_PNG_RASTER_DIMENSION, b_ as MarkerDescriptor, b$ as MermaidFamilyClassification, c0 as MermaidFamilyDetectionError, c1 as MindmapBody, c6 as NATIVE_PNG_HOST_ONLY_OPTION_FIELDS, c7 as NATIVE_PNG_OUTPUT_POLICY_FIELDS, c8 as NativePngHostOnlyOptionField, c9 as NativePngOutputPolicyField, ca as NodeId, cb as PNG_DEFAULT_FONT_FAMILY, cc as PNG_DEFAULT_SCALE, cd as PNG_FONT_SOURCES, ce as PNG_NAPI_RUNTIME, cf as PNG_OUTPUT_OPTION_FIELDS, cg as PNG_OUTPUT_OPTION_FIELD_DESCRIPTORS, ch as PNG_OUTPUT_POLICY_VERSION, ci as PNG_WASM_RUNTIME, cj as PORTABLE_PNG_OUTPUT_OPTION_FIELDS, ck as PRIMITIVE_REALIZATIONS, cm as ParticipantId, cn as PieBody, cp as PieSlice, cr as PngFitTo, cs as PngFontSource, ct as PngOutputOptionField, cu as PngOutputOptionFieldDescriptor, cv as PngOutputOptionInputKind, cw as PngOutputOptionPolicyState, cx as PngOutputOptionReceiptState, cy as PngOutputOptionScope, a as PngOutputPolicyInput, cz as PngRasterDimensions, c as PngRuntimeProvenance, cA as PortSemanticRole, cB as PortSide, cC as PortablePngOutputOptionField, cD as PortablePngOutputOptions, cE as PreservedDiagramBody, cF as PreservedSourceSpans, cG as PreservedValidDiagram, cH as QuadrantAxis, cI as QuadrantBody, cK as QuadrantPoint, cM as RENDER_CONTRACT_VERSION, cN as RENDER_OUTPUTS, cO as RENDER_OUTPUT_DESCRIPTORS, cP as RESOURCE_MANIFEST, cQ as RESOURCE_MANIFEST_VERSION, cR as ROLE_STYLE_PROPERTY_DESCRIPTORS, cS as RadarBody, cT as RadarBodyAxis, cU as RadarBodyCurve, cX as RegionContainmentCertificate, cY as RenderCapabilityError, cZ as RenderOutputDescriptor, c_ as RenderOutputTransports, d1 as RenderedLayoutEdge, d2 as RenderedLayoutGroup, d3 as RenderedLayoutNode, d as RenderedRegion, d5 as ResolvedPngOutputPolicy, d6 as ResolvedTerminalOutputPolicy, d8 as RoleStyleFor, d9 as RoleStyleSpec, da as RoleStyles, db as RouteBlocker, dc as RouteCertificate, dd as RouteClass, de as RoutePortAssignment, df as SCENE_CONTRACT_VERSION, dg as SCENE_ROLE_DESCRIPTORS, dh as SCENE_VALIDATION_LIMITS, di as SCENE_VALIDATION_VERSION, dj as SEMANTIC_BINDING_CHANNELS, dk as SHARED_RENDER_OPTION_FIELDS, dl as STYLE_COLOR_TOKEN_DESCRIPTORS, dm as STYLE_SPEC_FIELD_DESCRIPTORS, dn as STYLE_SPEC_FORMAT_VERSION, dp as SceneDoc, dq as SceneNode, dr as SceneRole, ds as SceneValidationDiagnostic, dt as SceneValidationDiagnosticCode, du as SceneValidationError, dv as SceneValidationOptions, dw as SceneValidationResult, dx as SemanticBinding, dy as SemanticBindingChannel, dz as SemanticChannels, dA as SemanticSlots, dB as SequenceBody, dC as SequenceMessage, dD as SequenceMessageStyle, dF as SequenceParticipant, dH as SerializedFlowchartGraph, dI as SourceComment, dJ as SourceMap, dK as SourceMapSpans, dL as SourcePreservationReceipt, dM as SourceSpan, dN as SourceSpanPoint, dO as StateBody, dQ as StateNode, dR as StateTransition, dT as StyleBackend, dU as StyleBackendContext, dV as StyleColors, dW as StyleDescriptor, dX as StyleInput, dY as StyleReferenceResolution, dZ as StyleRegistrationOptions, d_ as StyleSpec, d$ as TERMINAL_BOUNDED_PADDING_X, e0 as TERMINAL_DEFAULT_BOX_BORDER_PADDING, e1 as TERMINAL_DEFAULT_PADDING_X, e2 as TERMINAL_DEFAULT_PADDING_Y, e3 as TERMINAL_OUTPUT_POLICY_VERSION, e4 as TEXT_MEASUREMENT_CONTRACT, e5 as TerminalOutputPolicyError, e6 as TerminalOutputPolicyInput, e7 as TextMeasurementContract, e8 as TextMeasurementInput, e9 as TextMeasurementResult, ea as Tier1WarningCode, eb as Tier2WarningCode, ec as TimelineBody, ed as TimelineEvent, ef as TimelinePeriod, eg as TimelineSection, ei as UNREGISTERED_FAMILY_CAPABILITY_STATES, ej as UPSTREAM_MERMAID_FAMILY_INDEX, ek as UpstreamFamilyDescriptor, el as UpstreamHeaderDescriptor, em as UpstreamHeaderMatch, en as UpstreamManifestDiff, eo as UpstreamMermaidFamilyIndex, ep as UpstreamMermaidManifest, er as ValidDiagramMeta, ev as WARNING_SEVERITY, ew as WARNING_TIER, ex as WarningCode, ey as WarningSeverity, ez as WarningTier, eA as XyChartAxis, eB as XyChartAxisSpec, eC as XyChartBody, eE as XyChartSeries, eG as asArchitecture, eH as asClass, eI as asEr, eJ as asFlowchart, eK as asGantt, eL as asGitGraph, eM as asJourney, eN as asMindmap, eO as asPie, eP as asQuadrant, eQ as asRadar, eR as asSequence, eS as asState, eT as asTimeline, eU as asXyChart, eV as assertHostedPngRasterBudget, eW as assertPngRasterBudget, eX as assertValidSceneDoc, eY as buildExternalScene, eZ as builtinFamilyMetadata, e_ as classifyMermaidFamilyFromFirstLine, e$ as createExtensionIdentity, f0 as declareFamilyScenePrimitiveEvidence, f1 as detectRegisteredFamilyFromFirstLine, f2 as effectiveFamilyCapabilityState, f3 as err, f4 as findUpstreamFamilyByHeader, f5 as getBackend, f6 as getFamily, f7 as getFamilyConformanceReport, f8 as getStyle, f9 as hostedFontResource, fa as inferBackend, fb as isBuiltinFamilyId, fc as isExternalFamilyId, fd as knownBackendDescriptors, fe as knownBuiltinFamilies, ff as knownFamilies, fg as knownStyleDescriptors, fh as knownStyles, fi as measureText, fj as measureTextWidth, fk as negotiateCapabilities, fl as negotiateRenderCapabilities, fm as normalizePortablePngBackground, fn as ok, fo as omitPngOutputOptions, fp as parseRegisteredMermaid, fq as parseSemVer, fr as pngNapiRuntimeProvenance, fs as pngOutputOptionsJsonSchema, ft as pngRasterDimensions, fu as prepareSvgForPngRasterization, fv as projectNativePngOutputPolicyInput, fw as projectPortablePngOutputOptions, fx as registerBackend, fy as registerStyle, fz as resolvePngOutputPolicy, fA as resolvePortablePngOutputPolicy, fB as resolveSceneRoleTraits, fC as resolveStyleReference, fD as resolveStyleStack, fE as resolveTerminalOutputPolicy, fF as runBackendConformance, fG as sceneRoleTraits, fH as semVerSatisfies, fI as sharedRenderOptionsJsonSchema, fJ as styleInputJsonSchema, fK as styleSpecJsonSchema, fL as svgIntrinsicDimensions, fM as terminalConnectorCapabilityClaims, fN as toFinite, fO as validatePrimitiveCapabilities, fP as validateResourceManifest, fQ as validateSceneDoc, fR as validateSerializableRenderOptions, fS as validateStyleSpec, fT as verifyNoExternalRefs, fU as verifyResourceBytes } from './index-CLwYn6Im.js';
1
+ import { P as ParsedDiagram, d7 as Result, cl as ParseError, es as ValidDiagramPayload, eq as ValidDiagram, aP as ExtensionDiagramBody, c5 as MutationError, fV as Direction, bv as FlowchartMutationOp, bw as FlowchartValidDiagram, dP as StateMutationOp, dS as StateValidDiagram, dE as SequenceMutationOp, dG as SequenceValidDiagram, ee as TimelineMutationOp, eh as TimelineValidDiagram, a7 as ClassMutationOp, ac as ClassValidDiagram, aL as ErMutationOp, aN as ErValidDiagram, bM as JourneyMutationOp, bP as JourneyValidDiagram, n as ArchitectureMutationOp, q as ArchitectureValidDiagram, eD as XyChartMutationOp, eF as XyChartValidDiagram, co as PieMutationOp, cq as PieValidDiagram, cJ as QuadrantMutationOp, cL as QuadrantValidDiagram, bB as GanttMutationOp, bE as GanttValidDiagram, c2 as MindmapMutationOp, c3 as MindmapValidDiagram, bG as GitGraphMutationOp, bH as GitGraphValidDiagram, cV as RadarMutationOp, cW as RadarValidDiagram, aA as DiagramKind, f as AnyMutationOp, c4 as MutableValidDiagram, fW as MermaidEdge, eu as VerifyResult, et as VerifyOptions, d0 as RenderedLayout, bQ as LayoutRouteCertificate, bd as FamilyConformanceReport, bf as FamilyDescriptor, bi as FamilyId, fX as PositionedDiagram, bm as FamilyPositionedProjectionOptions, bn as FamilyPositionedView, d4 as RenderedRegionKind, fY as TerminalProjectionDiagnosticCode, D as DiagramActionRecord, A as AsciiRenderOptions, ay as DiagramAnalysis, R as RenderOptions, b as RenderRequestReceipt, fZ as renderMermaidASCII$1, c$ as RenderedAscii, f_ as renderMermaidSVG$1, f$ as RenderedSvg } from './index-Do8z5rPq.js';
2
+ export { e as Accessibility, g as AnyPort, h as ArchitectureBody, i as ArchitectureEdge, j as ArchitectureEndpoint, k as ArchitectureEndpointBoundary, l as ArchitectureGroup, m as ArchitectureJunction, o as ArchitectureService, p as ArchitectureSide, r as ArchitectureVisualOverrides, s as AsciiRenderColorMode, t as AsciiWidthError, u as AsciiWidthErrorReason, B as BACKEND_CONFORMANCE_CHECK_IDS, v as BACKEND_CONFORMANCE_FIXTURE_ID, w as BACKEND_CONFORMANCE_VERSION, x as BINDABLE_ROLE_STYLE_PROPERTIES, y as BINDABLE_SCENE_ROLES, z as BRAND_CONSTRAINT_DESCRIPTORS, C as BRAND_CONSTRAINT_KINDS, E as BUILTIN_FAMILY_METADATA, F as BUILTIN_FAMILY_METADATA_COVERS_DIAGRAM_KIND, G as BUILTIN_SCENE_ROLE_TRAITS, I as BackendCapabilityConformanceResult, J as BackendCapabilityConformanceStatus, K as BackendConformanceCheck, L as BackendConformanceCheckId, M as BackendConformanceReport, N as BackendDescriptor, O as BackendRegistrationOptions, Q as BindableSceneRole, S as BrandConstraint, T as BrandConstraintAction, U as BrandConstraintKind, V as BuiltinFamilyId, W as BuiltinFamilyMetadata, X as CAPABILITY_NEGOTIATION_VERSION, Y as CORE_CAPABILITY_OFFERS, Z as CORE_SCENE_FEATURES, _ as CORE_SCENE_OPERATIONS, $ as CORE_SCENE_PRIMITIVES, a0 as CapabilityDecision, a1 as CapabilityId, a2 as CapabilityOffer, a3 as CapabilityRequirement, a4 as CapabilityRequirementLevel, a5 as CapabilityResolution, a6 as ClassBody, a8 as ClassNode, a9 as ClassNote, aa as ClassRelation, ab as ClassRelationKind, ad as CliRenderTransport, ae as CodeModeRenderTransport, af as ConnectorContourSemantics, ag as ConnectorEndpoints, ah as ConnectorGeometry, ai as ConnectorHitGeometry, aj as ConnectorLabelDescriptor, ak as ConnectorMark, al as ConnectorRelationship, am as ConnectorRoute, an as ConnectorStroke, ao as ConnectorSubpath, ap as ConnectorTerminalLabelProjection, aq as ConnectorTerminalMarkerPlacement, ar as ConnectorTerminalMarkerProjection, as as ConnectorTerminalProjection, at as ConnectorTerminalStrokeLoss, au as DEFAULT_LABEL_CHAR_CAP, av as DefaultBackend, aw as DiagramActionKind, ax as DiagramActionSecurity, az as DiagramBody, aB as DiamondFacet, aC as EXACT_ROLE_STYLE_CONTRACT, aD as EXACT_STYLE_SCENE_ROLES, aE as EXTERNAL_SCENE_API_VERSION, aF as EdgeId, aG as EdgeRouteCertificate, aH as ErAttribute, aI as ErBody, aJ as ErCardinality, aK as ErEntity, aM as ErRelation, aO as ExactStyleSceneRole, aQ as ExtensionIdentity, aR as ExtensionValidDiagram, aS as ExternalFamilyId, aT as ExternalSceneConnector, aU as ExternalSceneConnectorGeometry, aV as ExternalSceneConnectorLabel, aW as ExternalSceneContainer, aX as ExternalSceneDataMark, aY as ExternalSceneDocument, aZ as ExternalSceneGeometry, a_ as ExternalSceneInput, a$ as ExternalSceneMarker, b0 as ExternalSceneNode, b1 as ExternalSceneNodeBase, b2 as ExternalSceneShape, b3 as ExternalSceneText, b4 as ExtractedLabel, b5 as FAMILY_CAPABILITY_COLUMNS, b6 as FAMILY_CONFORMANCE_MAX_EXAMPLE_BYTES, b7 as FAMILY_CONFORMANCE_VERSION, b8 as FAMILY_DESCRIPTOR_CONTRACT_VERSION, b9 as FamilyCapability, ba as FamilyCapabilityConformanceResult, bb as FamilyCapabilityEvidence, bc as FamilyCapabilityState, be as FamilyConformanceStatus, bg as FamilyDetectionDiagnostic, bh as FamilyEdgeRouteCertificate, bj as FamilyOperations, bk as FamilyParsedBody, bl as FamilyPositionedProjectionContext, bo as FamilyRouteCertificate, bp as FamilyScenePositivePrimitive, bq as FamilyScenePrimitiveApplicability, br as FamilyScenePrimitiveEvidence, bs as FamilySceneRolePrimitiveDeclaration, bt as FeedbackEdgeAnalysis, bu as Finite, bx as GanttBody, by as GanttBodySection, bz as GanttBodyTask, bA as GanttBodyTaskTag, bC as GanttScheduleAnalysisSummary, bD as GanttStatement, bF as GitGraphBody, bI as GroupId, bJ as HOSTED_FONT_RESOURCES, H as HostBackendPolicy, bK as InitDirective, bL as JourneyBody, bN as JourneySection, bO as JourneyTask, bR as LayoutRouteClass, bS as LayoutWarning, bT as LibraryRenderTransport, bU as MAX_HOSTED_PNG_BYTES, bV as MAX_HOSTED_PNG_PIXELS, bW as MAX_PNG_FONT_DIRECTORIES, bX as MAX_PNG_FONT_DIRECTORY_LENGTH, bY as MAX_PNG_PIXELS, bZ as MAX_PNG_RASTER_DIMENSION, b_ as MarkerDescriptor, b$ as MermaidFamilyClassification, c0 as MermaidFamilyDetectionError, c1 as MindmapBody, c6 as NATIVE_PNG_HOST_ONLY_OPTION_FIELDS, c7 as NATIVE_PNG_OUTPUT_POLICY_FIELDS, c8 as NativePngHostOnlyOptionField, c9 as NativePngOutputPolicyField, ca as NodeId, cb as PNG_DEFAULT_FONT_FAMILY, cc as PNG_DEFAULT_SCALE, cd as PNG_FONT_SOURCES, ce as PNG_NAPI_RUNTIME, cf as PNG_OUTPUT_OPTION_FIELDS, cg as PNG_OUTPUT_OPTION_FIELD_DESCRIPTORS, ch as PNG_OUTPUT_POLICY_VERSION, ci as PNG_WASM_RUNTIME, cj as PORTABLE_PNG_OUTPUT_OPTION_FIELDS, ck as PRIMITIVE_REALIZATIONS, cm as ParticipantId, cn as PieBody, cp as PieSlice, cr as PngFitTo, cs as PngFontSource, ct as PngOutputOptionField, cu as PngOutputOptionFieldDescriptor, cv as PngOutputOptionInputKind, cw as PngOutputOptionPolicyState, cx as PngOutputOptionReceiptState, cy as PngOutputOptionScope, a as PngOutputPolicyInput, cz as PngRasterDimensions, c as PngRuntimeProvenance, cA as PortSemanticRole, cB as PortSide, cC as PortablePngOutputOptionField, cD as PortablePngOutputOptions, cE as PreservedDiagramBody, cF as PreservedSourceSpans, cG as PreservedValidDiagram, cH as QuadrantAxis, cI as QuadrantBody, cK as QuadrantPoint, cM as RENDER_CONTRACT_VERSION, cN as RENDER_OUTPUTS, cO as RENDER_OUTPUT_DESCRIPTORS, cP as RESOURCE_MANIFEST, cQ as RESOURCE_MANIFEST_VERSION, cR as ROLE_STYLE_PROPERTY_DESCRIPTORS, cS as RadarBody, cT as RadarBodyAxis, cU as RadarBodyCurve, cX as RegionContainmentCertificate, cY as RenderCapabilityError, cZ as RenderOutputDescriptor, c_ as RenderOutputTransports, d1 as RenderedLayoutEdge, d2 as RenderedLayoutGroup, d3 as RenderedLayoutNode, d as RenderedRegion, d5 as ResolvedPngOutputPolicy, d6 as ResolvedTerminalOutputPolicy, d8 as RoleStyleFor, d9 as RoleStyleSpec, da as RoleStyles, db as RouteBlocker, dc as RouteCertificate, dd as RouteClass, de as RoutePortAssignment, df as SCENE_CONTRACT_VERSION, dg as SCENE_ROLE_DESCRIPTORS, dh as SCENE_VALIDATION_LIMITS, di as SCENE_VALIDATION_VERSION, dj as SEMANTIC_BINDING_CHANNELS, dk as SHARED_RENDER_OPTION_FIELDS, dl as STYLE_COLOR_TOKEN_DESCRIPTORS, dm as STYLE_SPEC_FIELD_DESCRIPTORS, dn as STYLE_SPEC_FORMAT_VERSION, dp as SceneDoc, dq as SceneNode, dr as SceneRole, ds as SceneValidationDiagnostic, dt as SceneValidationDiagnosticCode, du as SceneValidationError, dv as SceneValidationOptions, dw as SceneValidationResult, dx as SemanticBinding, dy as SemanticBindingChannel, dz as SemanticChannels, dA as SemanticSlots, dB as SequenceBody, dC as SequenceMessage, dD as SequenceMessageStyle, dF as SequenceParticipant, dH as SerializedFlowchartGraph, dI as SourceComment, dJ as SourceMap, dK as SourceMapSpans, dL as SourcePreservationReceipt, dM as SourceSpan, dN as SourceSpanPoint, dO as StateBody, dQ as StateNode, dR as StateTransition, dT as StyleBackend, dU as StyleBackendContext, dV as StyleColors, dW as StyleDescriptor, dX as StyleInput, dY as StyleReferenceResolution, dZ as StyleRegistrationOptions, d_ as StyleSpec, d$ as TERMINAL_BOUNDED_PADDING_X, e0 as TERMINAL_DEFAULT_BOX_BORDER_PADDING, e1 as TERMINAL_DEFAULT_PADDING_X, e2 as TERMINAL_DEFAULT_PADDING_Y, e3 as TERMINAL_OUTPUT_POLICY_VERSION, e4 as TEXT_MEASUREMENT_CONTRACT, e5 as TerminalOutputPolicyError, e6 as TerminalOutputPolicyInput, e7 as TextMeasurementContract, e8 as TextMeasurementInput, e9 as TextMeasurementResult, ea as Tier1WarningCode, eb as Tier2WarningCode, ec as TimelineBody, ed as TimelineEvent, ef as TimelinePeriod, eg as TimelineSection, ei as UNREGISTERED_FAMILY_CAPABILITY_STATES, ej as UPSTREAM_MERMAID_FAMILY_INDEX, ek as UpstreamFamilyDescriptor, el as UpstreamHeaderDescriptor, em as UpstreamHeaderMatch, en as UpstreamManifestDiff, eo as UpstreamMermaidFamilyIndex, ep as UpstreamMermaidManifest, er as ValidDiagramMeta, ev as WARNING_SEVERITY, ew as WARNING_TIER, ex as WarningCode, ey as WarningSeverity, ez as WarningTier, eA as XyChartAxis, eB as XyChartAxisSpec, eC as XyChartBody, eE as XyChartSeries, eG as asArchitecture, eH as asClass, eI as asEr, eJ as asFlowchart, eK as asGantt, eL as asGitGraph, eM as asJourney, eN as asMindmap, eO as asPie, eP as asQuadrant, eQ as asRadar, eR as asSequence, eS as asState, eT as asTimeline, eU as asXyChart, eV as assertHostedPngRasterBudget, eW as assertPngRasterBudget, eX as assertValidSceneDoc, eY as buildExternalScene, eZ as builtinFamilyMetadata, e_ as classifyMermaidFamilyFromFirstLine, e$ as createExtensionIdentity, f0 as declareFamilyScenePrimitiveEvidence, f1 as detectRegisteredFamilyFromFirstLine, f2 as effectiveFamilyCapabilityState, f3 as err, f4 as findUpstreamFamilyByHeader, f5 as getBackend, f6 as getFamily, f7 as getFamilyConformanceReport, f8 as getStyle, f9 as hostedFontResource, fa as inferBackend, fb as isBuiltinFamilyId, fc as isExternalFamilyId, fd as knownBackendDescriptors, fe as knownBuiltinFamilies, ff as knownFamilies, fg as knownStyleDescriptors, fh as knownStyles, fi as measureText, fj as measureTextWidth, fk as negotiateCapabilities, fl as negotiateRenderCapabilities, fm as normalizePortablePngBackground, fn as ok, fo as omitPngOutputOptions, fp as parseRegisteredMermaid, fq as parseSemVer, fr as pngNapiRuntimeProvenance, fs as pngOutputOptionsJsonSchema, ft as pngRasterDimensions, fu as prepareSvgForPngRasterization, fv as projectNativePngOutputPolicyInput, fw as projectPortablePngOutputOptions, fx as registerBackend, fy as registerStyle, fz as resolvePngOutputPolicy, fA as resolvePortablePngOutputPolicy, fB as resolveSceneRoleTraits, fC as resolveStyleReference, fD as resolveStyleStack, fE as resolveTerminalOutputPolicy, fF as runBackendConformance, fG as sceneRoleTraits, fH as semVerSatisfies, fI as sharedRenderOptionsJsonSchema, fJ as styleInputJsonSchema, fK as styleSpecJsonSchema, fL as svgIntrinsicDimensions, fM as terminalConnectorCapabilityClaims, fN as toFinite, fO as validatePrimitiveCapabilities, fP as validateResourceManifest, fQ as validateSceneDoc, fR as validateSerializableRenderOptions, fS as validateStyleSpec, fT as verifyNoExternalRefs, fU as verifyResourceBytes } from './index-Do8z5rPq.js';
3
3
 
4
4
  type MermaidFact = string;
5
5
  interface CheckMermaidObjectSpec {
@@ -39,7 +39,12 @@ interface SerializeOptions {
39
39
  /**
40
40
  * Wrapper emission policy. 'verbatim' (default) re-emits the leading source
41
41
  * wrapper (frontmatter, init directives, comments) byte-identically from
42
- * `meta.wrapperSource`. 'canonical' synthesizes Mermaid's documented shape
42
+ * `meta.wrapperSource`, then re-emits any init directive authored *after*
43
+ * the family header that the serialized body does not already own — a
44
+ * structured serializer receives directive-free grammar, so without this the
45
+ * config would be lost. Such a directive therefore moves ahead of the
46
+ * header; source-preserving bodies keep theirs in place and are unaffected.
47
+ * 'canonical' synthesizes Mermaid's documented shape
43
48
  * instead: one frontmatter block with `title`/`displayMode` at the top
44
49
  * level and everything else nested under `config:`, init directives folded
45
50
  * in (re-emitted raw only when their payload could not be folded), and
@@ -38,7 +38,7 @@ import {
38
38
  validateOp,
39
39
  verifyMermaid,
40
40
  verifySummary
41
- } from "./chunk-AVCWKYII.js";
41
+ } from "./chunk-BSVM3VMO.js";
42
42
  import {
43
43
  AsciiWidthError,
44
44
  BACKEND_CONFORMANCE_CHECK_IDS,
@@ -196,7 +196,7 @@ import {
196
196
  validateStyleSpec,
197
197
  verifyNoExternalRefs,
198
198
  verifyResourceBytes
199
- } from "./chunk-WHYJLDYG.js";
199
+ } from "./chunk-XVY324NY.js";
200
200
  export {
201
201
  ASCII_ROUTE_PARITY_CONTRACT,
202
202
  AsciiWidthError,
package/dist/agent.d.ts CHANGED
@@ -1,7 +1,7 @@
1
1
  import { AsciiWarning } from './agent-core.js';
2
2
  export { ASCII_ROUTE_PARITY_CONTRACT, ApplyOpsInput, AsciiRegion, AsciiWarningCode, AsciiWithMeta, BOUND_PROVENANCE, BoundBasis, BoundProvenance, BuildError, CheckMermaidObjectSpec, CheckMermaidResult, CheckMermaidSpec, CheckedBuildError, CreateMermaidOptions, DEFAULT_BOUNDS, DescribeOptions, DescribeTree, FamilyConformanceError, LayoutCertificateProof, LayoutMermaidOptions, LayoutRenderOptions, MermaidFact, OpEnvelope, OpFamily, OpFieldDoc, OpValidationError, QualityBounds, QualityMeasurementOptions, QualityMetrics, QualityVerdict, RankedViolation, RegionKind, RenderedLayoutArtifact, VerifySummary, ViolationSeverity, analyzeMermaid, analyzeMermaidSource, applyOps, asciiToMermaid, buildChecked, buildMermaid, checkMermaid, checkMermaidSource, checkQuality, collectActionRecords, createMermaid, describeMermaid, describeMermaidFacts, describeMermaidFactsSource, describeMermaidSource, describeMermaidTree, describeOps, edgeIdOf, hasOpSchema, layoutCertificateProof, layoutMermaid, layoutMermaidWithReceipt, measureQuality, mutate, mutateChecked, opMenu, opSignatures, projectPositionedView, registerFamily, renderMermaidASCII, renderMermaidASCIIWithMeta, renderMermaidASCIIWithReceipt, renderMermaidSVG, renderMermaidSVGWithReceipt, serializeMermaid, synthesizeFromGraph, validateOp, verifyMermaid, verifySummary } from './agent-core.js';
3
- import { P as ParsedDiagram, R as RenderOptions, a as PngOutputPolicyInput, b as RenderRequestReceipt, c as PngRuntimeProvenance, H as HostBackendPolicy, A as AsciiRenderOptions, d as RenderedRegion, D as DiagramActionRecord } from './index-CLwYn6Im.js';
4
- export { e as Accessibility, f as AnyMutationOp, g as AnyPort, h as ArchitectureBody, i as ArchitectureEdge, j as ArchitectureEndpoint, k as ArchitectureEndpointBoundary, l as ArchitectureGroup, m as ArchitectureJunction, n as ArchitectureMutationOp, o as ArchitectureService, p as ArchitectureSide, q as ArchitectureValidDiagram, r as ArchitectureVisualOverrides, s as AsciiRenderColorMode, t as AsciiWidthError, u as AsciiWidthErrorReason, B as BACKEND_CONFORMANCE_CHECK_IDS, v as BACKEND_CONFORMANCE_FIXTURE_ID, w as BACKEND_CONFORMANCE_VERSION, x as BINDABLE_ROLE_STYLE_PROPERTIES, y as BINDABLE_SCENE_ROLES, z as BRAND_CONSTRAINT_DESCRIPTORS, C as BRAND_CONSTRAINT_KINDS, E as BUILTIN_FAMILY_METADATA, F as BUILTIN_FAMILY_METADATA_COVERS_DIAGRAM_KIND, G as BUILTIN_SCENE_ROLE_TRAITS, I as BackendCapabilityConformanceResult, J as BackendCapabilityConformanceStatus, K as BackendConformanceCheck, L as BackendConformanceCheckId, M as BackendConformanceReport, N as BackendDescriptor, O as BackendRegistrationOptions, Q as BindableSceneRole, S as BrandConstraint, T as BrandConstraintAction, U as BrandConstraintKind, V as BuiltinFamilyId, W as BuiltinFamilyMetadata, X as CAPABILITY_NEGOTIATION_VERSION, Y as CORE_CAPABILITY_OFFERS, Z as CORE_SCENE_FEATURES, _ as CORE_SCENE_OPERATIONS, $ as CORE_SCENE_PRIMITIVES, a0 as CapabilityDecision, a1 as CapabilityId, a2 as CapabilityOffer, a3 as CapabilityRequirement, a4 as CapabilityRequirementLevel, a5 as CapabilityResolution, a6 as ClassBody, a7 as ClassMutationOp, a8 as ClassNode, a9 as ClassNote, aa as ClassRelation, ab as ClassRelationKind, ac as ClassValidDiagram, ad as CliRenderTransport, ae as CodeModeRenderTransport, af as ConnectorContourSemantics, ag as ConnectorEndpoints, ah as ConnectorGeometry, ai as ConnectorHitGeometry, aj as ConnectorLabelDescriptor, ak as ConnectorMark, al as ConnectorRelationship, am as ConnectorRoute, an as ConnectorStroke, ao as ConnectorSubpath, ap as ConnectorTerminalLabelProjection, aq as ConnectorTerminalMarkerPlacement, ar as ConnectorTerminalMarkerProjection, as as ConnectorTerminalProjection, at as ConnectorTerminalStrokeLoss, au as DEFAULT_LABEL_CHAR_CAP, av as DefaultBackend, aw as DiagramActionKind, ax as DiagramActionSecurity, ay as DiagramAnalysis, az as DiagramBody, aA as DiagramKind, aB as DiamondFacet, aC as EXACT_ROLE_STYLE_CONTRACT, aD as EXACT_STYLE_SCENE_ROLES, aE as EXTERNAL_SCENE_API_VERSION, aF as EdgeId, aG as EdgeRouteCertificate, aH as ErAttribute, aI as ErBody, aJ as ErCardinality, aK as ErEntity, aL as ErMutationOp, aM as ErRelation, aN as ErValidDiagram, aO as ExactStyleSceneRole, aP as ExtensionDiagramBody, aQ as ExtensionIdentity, aR as ExtensionValidDiagram, aS as ExternalFamilyId, aT as ExternalSceneConnector, aU as ExternalSceneConnectorGeometry, aV as ExternalSceneConnectorLabel, aW as ExternalSceneContainer, aX as ExternalSceneDataMark, aY as ExternalSceneDocument, aZ as ExternalSceneGeometry, a_ as ExternalSceneInput, a$ as ExternalSceneMarker, b0 as ExternalSceneNode, b1 as ExternalSceneNodeBase, b2 as ExternalSceneShape, b3 as ExternalSceneText, b4 as ExtractedLabel, b5 as FAMILY_CAPABILITY_COLUMNS, b6 as FAMILY_CONFORMANCE_MAX_EXAMPLE_BYTES, b7 as FAMILY_CONFORMANCE_VERSION, b8 as FAMILY_DESCRIPTOR_CONTRACT_VERSION, b9 as FamilyCapability, ba as FamilyCapabilityConformanceResult, bb as FamilyCapabilityEvidence, bc as FamilyCapabilityState, bd as FamilyConformanceReport, be as FamilyConformanceStatus, bf as FamilyDescriptor, bg as FamilyDetectionDiagnostic, bh as FamilyEdgeRouteCertificate, bi as FamilyId, bj as FamilyOperations, bk as FamilyParsedBody, bl as FamilyPositionedProjectionContext, bm as FamilyPositionedProjectionOptions, bn as FamilyPositionedView, bo as FamilyRouteCertificate, bp as FamilyScenePositivePrimitive, bq as FamilyScenePrimitiveApplicability, br as FamilyScenePrimitiveEvidence, bs as FamilySceneRolePrimitiveDeclaration, bt as FeedbackEdgeAnalysis, bu as Finite, bv as FlowchartMutationOp, bw as FlowchartValidDiagram, bx as GanttBody, by as GanttBodySection, bz as GanttBodyTask, bA as GanttBodyTaskTag, bB as GanttMutationOp, bC as GanttScheduleAnalysisSummary, bD as GanttStatement, bE as GanttValidDiagram, bF as GitGraphBody, bG as GitGraphMutationOp, bH as GitGraphValidDiagram, bI as GroupId, bJ as HOSTED_FONT_RESOURCES, bK as InitDirective, bL as JourneyBody, bM as JourneyMutationOp, bN as JourneySection, bO as JourneyTask, bP as JourneyValidDiagram, bQ as LayoutRouteCertificate, bR as LayoutRouteClass, bS as LayoutWarning, bT as LibraryRenderTransport, bU as MAX_HOSTED_PNG_BYTES, bV as MAX_HOSTED_PNG_PIXELS, bW as MAX_PNG_FONT_DIRECTORIES, bX as MAX_PNG_FONT_DIRECTORY_LENGTH, bY as MAX_PNG_PIXELS, bZ as MAX_PNG_RASTER_DIMENSION, b_ as MarkerDescriptor, b$ as MermaidFamilyClassification, c0 as MermaidFamilyDetectionError, c1 as MindmapBody, c2 as MindmapMutationOp, c3 as MindmapValidDiagram, c4 as MutableValidDiagram, c5 as MutationError, c6 as NATIVE_PNG_HOST_ONLY_OPTION_FIELDS, c7 as NATIVE_PNG_OUTPUT_POLICY_FIELDS, c8 as NativePngHostOnlyOptionField, c9 as NativePngOutputPolicyField, ca as NodeId, cb as PNG_DEFAULT_FONT_FAMILY, cc as PNG_DEFAULT_SCALE, cd as PNG_FONT_SOURCES, ce as PNG_NAPI_RUNTIME, cf as PNG_OUTPUT_OPTION_FIELDS, cg as PNG_OUTPUT_OPTION_FIELD_DESCRIPTORS, ch as PNG_OUTPUT_POLICY_VERSION, ci as PNG_WASM_RUNTIME, cj as PORTABLE_PNG_OUTPUT_OPTION_FIELDS, ck as PRIMITIVE_REALIZATIONS, cl as ParseError, cm as ParticipantId, cn as PieBody, co as PieMutationOp, cp as PieSlice, cq as PieValidDiagram, cr as PngFitTo, cs as PngFontSource, ct as PngOutputOptionField, cu as PngOutputOptionFieldDescriptor, cv as PngOutputOptionInputKind, cw as PngOutputOptionPolicyState, cx as PngOutputOptionReceiptState, cy as PngOutputOptionScope, cz as PngRasterDimensions, cA as PortSemanticRole, cB as PortSide, cC as PortablePngOutputOptionField, cD as PortablePngOutputOptions, cE as PreservedDiagramBody, cF as PreservedSourceSpans, cG as PreservedValidDiagram, cH as QuadrantAxis, cI as QuadrantBody, cJ as QuadrantMutationOp, cK as QuadrantPoint, cL as QuadrantValidDiagram, cM as RENDER_CONTRACT_VERSION, cN as RENDER_OUTPUTS, cO as RENDER_OUTPUT_DESCRIPTORS, cP as RESOURCE_MANIFEST, cQ as RESOURCE_MANIFEST_VERSION, cR as ROLE_STYLE_PROPERTY_DESCRIPTORS, cS as RadarBody, cT as RadarBodyAxis, cU as RadarBodyCurve, cV as RadarMutationOp, cW as RadarValidDiagram, cX as RegionContainmentCertificate, cY as RenderCapabilityError, cZ as RenderOutputDescriptor, c_ as RenderOutputTransports, c$ as RenderedAscii, d0 as RenderedLayout, d1 as RenderedLayoutEdge, d2 as RenderedLayoutGroup, d3 as RenderedLayoutNode, d4 as RenderedRegionKind, d5 as ResolvedPngOutputPolicy, d6 as ResolvedTerminalOutputPolicy, d7 as Result, d8 as RoleStyleFor, d9 as RoleStyleSpec, da as RoleStyles, db as RouteBlocker, dc as RouteCertificate, dd as RouteClass, de as RoutePortAssignment, df as SCENE_CONTRACT_VERSION, dg as SCENE_ROLE_DESCRIPTORS, dh as SCENE_VALIDATION_LIMITS, di as SCENE_VALIDATION_VERSION, dj as SEMANTIC_BINDING_CHANNELS, dk as SHARED_RENDER_OPTION_FIELDS, dl as STYLE_COLOR_TOKEN_DESCRIPTORS, dm as STYLE_SPEC_FIELD_DESCRIPTORS, dn as STYLE_SPEC_FORMAT_VERSION, dp as SceneDoc, dq as SceneNode, dr as SceneRole, ds as SceneValidationDiagnostic, dt as SceneValidationDiagnosticCode, du as SceneValidationError, dv as SceneValidationOptions, dw as SceneValidationResult, dx as SemanticBinding, dy as SemanticBindingChannel, dz as SemanticChannels, dA as SemanticSlots, dB as SequenceBody, dC as SequenceMessage, dD as SequenceMessageStyle, dE as SequenceMutationOp, dF as SequenceParticipant, dG as SequenceValidDiagram, dH as SerializedFlowchartGraph, dI as SourceComment, dJ as SourceMap, dK as SourceMapSpans, dL as SourcePreservationReceipt, dM as SourceSpan, dN as SourceSpanPoint, dO as StateBody, dP as StateMutationOp, dQ as StateNode, dR as StateTransition, dS as StateValidDiagram, dT as StyleBackend, dU as StyleBackendContext, dV as StyleColors, dW as StyleDescriptor, dX as StyleInput, dY as StyleReferenceResolution, dZ as StyleRegistrationOptions, d_ as StyleSpec, d$ as TERMINAL_BOUNDED_PADDING_X, e0 as TERMINAL_DEFAULT_BOX_BORDER_PADDING, e1 as TERMINAL_DEFAULT_PADDING_X, e2 as TERMINAL_DEFAULT_PADDING_Y, e3 as TERMINAL_OUTPUT_POLICY_VERSION, e4 as TEXT_MEASUREMENT_CONTRACT, e5 as TerminalOutputPolicyError, e6 as TerminalOutputPolicyInput, e7 as TextMeasurementContract, e8 as TextMeasurementInput, e9 as TextMeasurementResult, ea as Tier1WarningCode, eb as Tier2WarningCode, ec as TimelineBody, ed as TimelineEvent, ee as TimelineMutationOp, ef as TimelinePeriod, eg as TimelineSection, eh as TimelineValidDiagram, ei as UNREGISTERED_FAMILY_CAPABILITY_STATES, ej as UPSTREAM_MERMAID_FAMILY_INDEX, ek as UpstreamFamilyDescriptor, el as UpstreamHeaderDescriptor, em as UpstreamHeaderMatch, en as UpstreamManifestDiff, eo as UpstreamMermaidFamilyIndex, ep as UpstreamMermaidManifest, eq as ValidDiagram, er as ValidDiagramMeta, es as ValidDiagramPayload, et as VerifyOptions, eu as VerifyResult, ev as WARNING_SEVERITY, ew as WARNING_TIER, ex as WarningCode, ey as WarningSeverity, ez as WarningTier, eA as XyChartAxis, eB as XyChartAxisSpec, eC as XyChartBody, eD as XyChartMutationOp, eE as XyChartSeries, eF as XyChartValidDiagram, eG as asArchitecture, eH as asClass, eI as asEr, eJ as asFlowchart, eK as asGantt, eL as asGitGraph, eM as asJourney, eN as asMindmap, eO as asPie, eP as asQuadrant, eQ as asRadar, eR as asSequence, eS as asState, eT as asTimeline, eU as asXyChart, eV as assertHostedPngRasterBudget, eW as assertPngRasterBudget, eX as assertValidSceneDoc, eY as buildExternalScene, eZ as builtinFamilyMetadata, e_ as classifyMermaidFamilyFromFirstLine, e$ as createExtensionIdentity, f0 as declareFamilyScenePrimitiveEvidence, f1 as detectRegisteredFamilyFromFirstLine, f2 as effectiveFamilyCapabilityState, f3 as err, f4 as findUpstreamFamilyByHeader, f5 as getBackend, f6 as getFamily, f7 as getFamilyConformanceReport, f8 as getStyle, f9 as hostedFontResource, fa as inferBackend, fb as isBuiltinFamilyId, fc as isExternalFamilyId, fd as knownBackendDescriptors, fe as knownBuiltinFamilies, ff as knownFamilies, fg as knownStyleDescriptors, fh as knownStyles, fi as measureText, fj as measureTextWidth, fk as negotiateCapabilities, fl as negotiateRenderCapabilities, fm as normalizePortablePngBackground, fn as ok, fo as omitPngOutputOptions, fp as parseRegisteredMermaid, fq as parseSemVer, fr as pngNapiRuntimeProvenance, fs as pngOutputOptionsJsonSchema, ft as pngRasterDimensions, fu as prepareSvgForPngRasterization, fv as projectNativePngOutputPolicyInput, fw as projectPortablePngOutputOptions, fx as registerBackend, fy as registerStyle, fz as resolvePngOutputPolicy, fA as resolvePortablePngOutputPolicy, fB as resolveSceneRoleTraits, fC as resolveStyleReference, fD as resolveStyleStack, fE as resolveTerminalOutputPolicy, fF as runBackendConformance, fG as sceneRoleTraits, fH as semVerSatisfies, fI as sharedRenderOptionsJsonSchema, fJ as styleInputJsonSchema, fK as styleSpecJsonSchema, fL as svgIntrinsicDimensions, fM as terminalConnectorCapabilityClaims, fN as toFinite, fO as validatePrimitiveCapabilities, fP as validateResourceManifest, fQ as validateSceneDoc, fR as validateSerializableRenderOptions, fS as validateStyleSpec, fT as verifyNoExternalRefs, fU as verifyResourceBytes } from './index-CLwYn6Im.js';
3
+ import { P as ParsedDiagram, R as RenderOptions, a as PngOutputPolicyInput, b as RenderRequestReceipt, c as PngRuntimeProvenance, H as HostBackendPolicy, A as AsciiRenderOptions, d as RenderedRegion, D as DiagramActionRecord } from './index-Do8z5rPq.js';
4
+ export { e as Accessibility, f as AnyMutationOp, g as AnyPort, h as ArchitectureBody, i as ArchitectureEdge, j as ArchitectureEndpoint, k as ArchitectureEndpointBoundary, l as ArchitectureGroup, m as ArchitectureJunction, n as ArchitectureMutationOp, o as ArchitectureService, p as ArchitectureSide, q as ArchitectureValidDiagram, r as ArchitectureVisualOverrides, s as AsciiRenderColorMode, t as AsciiWidthError, u as AsciiWidthErrorReason, B as BACKEND_CONFORMANCE_CHECK_IDS, v as BACKEND_CONFORMANCE_FIXTURE_ID, w as BACKEND_CONFORMANCE_VERSION, x as BINDABLE_ROLE_STYLE_PROPERTIES, y as BINDABLE_SCENE_ROLES, z as BRAND_CONSTRAINT_DESCRIPTORS, C as BRAND_CONSTRAINT_KINDS, E as BUILTIN_FAMILY_METADATA, F as BUILTIN_FAMILY_METADATA_COVERS_DIAGRAM_KIND, G as BUILTIN_SCENE_ROLE_TRAITS, I as BackendCapabilityConformanceResult, J as BackendCapabilityConformanceStatus, K as BackendConformanceCheck, L as BackendConformanceCheckId, M as BackendConformanceReport, N as BackendDescriptor, O as BackendRegistrationOptions, Q as BindableSceneRole, S as BrandConstraint, T as BrandConstraintAction, U as BrandConstraintKind, V as BuiltinFamilyId, W as BuiltinFamilyMetadata, X as CAPABILITY_NEGOTIATION_VERSION, Y as CORE_CAPABILITY_OFFERS, Z as CORE_SCENE_FEATURES, _ as CORE_SCENE_OPERATIONS, $ as CORE_SCENE_PRIMITIVES, a0 as CapabilityDecision, a1 as CapabilityId, a2 as CapabilityOffer, a3 as CapabilityRequirement, a4 as CapabilityRequirementLevel, a5 as CapabilityResolution, a6 as ClassBody, a7 as ClassMutationOp, a8 as ClassNode, a9 as ClassNote, aa as ClassRelation, ab as ClassRelationKind, ac as ClassValidDiagram, ad as CliRenderTransport, ae as CodeModeRenderTransport, af as ConnectorContourSemantics, ag as ConnectorEndpoints, ah as ConnectorGeometry, ai as ConnectorHitGeometry, aj as ConnectorLabelDescriptor, ak as ConnectorMark, al as ConnectorRelationship, am as ConnectorRoute, an as ConnectorStroke, ao as ConnectorSubpath, ap as ConnectorTerminalLabelProjection, aq as ConnectorTerminalMarkerPlacement, ar as ConnectorTerminalMarkerProjection, as as ConnectorTerminalProjection, at as ConnectorTerminalStrokeLoss, au as DEFAULT_LABEL_CHAR_CAP, av as DefaultBackend, aw as DiagramActionKind, ax as DiagramActionSecurity, ay as DiagramAnalysis, az as DiagramBody, aA as DiagramKind, aB as DiamondFacet, aC as EXACT_ROLE_STYLE_CONTRACT, aD as EXACT_STYLE_SCENE_ROLES, aE as EXTERNAL_SCENE_API_VERSION, aF as EdgeId, aG as EdgeRouteCertificate, aH as ErAttribute, aI as ErBody, aJ as ErCardinality, aK as ErEntity, aL as ErMutationOp, aM as ErRelation, aN as ErValidDiagram, aO as ExactStyleSceneRole, aP as ExtensionDiagramBody, aQ as ExtensionIdentity, aR as ExtensionValidDiagram, aS as ExternalFamilyId, aT as ExternalSceneConnector, aU as ExternalSceneConnectorGeometry, aV as ExternalSceneConnectorLabel, aW as ExternalSceneContainer, aX as ExternalSceneDataMark, aY as ExternalSceneDocument, aZ as ExternalSceneGeometry, a_ as ExternalSceneInput, a$ as ExternalSceneMarker, b0 as ExternalSceneNode, b1 as ExternalSceneNodeBase, b2 as ExternalSceneShape, b3 as ExternalSceneText, b4 as ExtractedLabel, b5 as FAMILY_CAPABILITY_COLUMNS, b6 as FAMILY_CONFORMANCE_MAX_EXAMPLE_BYTES, b7 as FAMILY_CONFORMANCE_VERSION, b8 as FAMILY_DESCRIPTOR_CONTRACT_VERSION, b9 as FamilyCapability, ba as FamilyCapabilityConformanceResult, bb as FamilyCapabilityEvidence, bc as FamilyCapabilityState, bd as FamilyConformanceReport, be as FamilyConformanceStatus, bf as FamilyDescriptor, bg as FamilyDetectionDiagnostic, bh as FamilyEdgeRouteCertificate, bi as FamilyId, bj as FamilyOperations, bk as FamilyParsedBody, bl as FamilyPositionedProjectionContext, bm as FamilyPositionedProjectionOptions, bn as FamilyPositionedView, bo as FamilyRouteCertificate, bp as FamilyScenePositivePrimitive, bq as FamilyScenePrimitiveApplicability, br as FamilyScenePrimitiveEvidence, bs as FamilySceneRolePrimitiveDeclaration, bt as FeedbackEdgeAnalysis, bu as Finite, bv as FlowchartMutationOp, bw as FlowchartValidDiagram, bx as GanttBody, by as GanttBodySection, bz as GanttBodyTask, bA as GanttBodyTaskTag, bB as GanttMutationOp, bC as GanttScheduleAnalysisSummary, bD as GanttStatement, bE as GanttValidDiagram, bF as GitGraphBody, bG as GitGraphMutationOp, bH as GitGraphValidDiagram, bI as GroupId, bJ as HOSTED_FONT_RESOURCES, bK as InitDirective, bL as JourneyBody, bM as JourneyMutationOp, bN as JourneySection, bO as JourneyTask, bP as JourneyValidDiagram, bQ as LayoutRouteCertificate, bR as LayoutRouteClass, bS as LayoutWarning, bT as LibraryRenderTransport, bU as MAX_HOSTED_PNG_BYTES, bV as MAX_HOSTED_PNG_PIXELS, bW as MAX_PNG_FONT_DIRECTORIES, bX as MAX_PNG_FONT_DIRECTORY_LENGTH, bY as MAX_PNG_PIXELS, bZ as MAX_PNG_RASTER_DIMENSION, b_ as MarkerDescriptor, b$ as MermaidFamilyClassification, c0 as MermaidFamilyDetectionError, c1 as MindmapBody, c2 as MindmapMutationOp, c3 as MindmapValidDiagram, c4 as MutableValidDiagram, c5 as MutationError, c6 as NATIVE_PNG_HOST_ONLY_OPTION_FIELDS, c7 as NATIVE_PNG_OUTPUT_POLICY_FIELDS, c8 as NativePngHostOnlyOptionField, c9 as NativePngOutputPolicyField, ca as NodeId, cb as PNG_DEFAULT_FONT_FAMILY, cc as PNG_DEFAULT_SCALE, cd as PNG_FONT_SOURCES, ce as PNG_NAPI_RUNTIME, cf as PNG_OUTPUT_OPTION_FIELDS, cg as PNG_OUTPUT_OPTION_FIELD_DESCRIPTORS, ch as PNG_OUTPUT_POLICY_VERSION, ci as PNG_WASM_RUNTIME, cj as PORTABLE_PNG_OUTPUT_OPTION_FIELDS, ck as PRIMITIVE_REALIZATIONS, cl as ParseError, cm as ParticipantId, cn as PieBody, co as PieMutationOp, cp as PieSlice, cq as PieValidDiagram, cr as PngFitTo, cs as PngFontSource, ct as PngOutputOptionField, cu as PngOutputOptionFieldDescriptor, cv as PngOutputOptionInputKind, cw as PngOutputOptionPolicyState, cx as PngOutputOptionReceiptState, cy as PngOutputOptionScope, cz as PngRasterDimensions, cA as PortSemanticRole, cB as PortSide, cC as PortablePngOutputOptionField, cD as PortablePngOutputOptions, cE as PreservedDiagramBody, cF as PreservedSourceSpans, cG as PreservedValidDiagram, cH as QuadrantAxis, cI as QuadrantBody, cJ as QuadrantMutationOp, cK as QuadrantPoint, cL as QuadrantValidDiagram, cM as RENDER_CONTRACT_VERSION, cN as RENDER_OUTPUTS, cO as RENDER_OUTPUT_DESCRIPTORS, cP as RESOURCE_MANIFEST, cQ as RESOURCE_MANIFEST_VERSION, cR as ROLE_STYLE_PROPERTY_DESCRIPTORS, cS as RadarBody, cT as RadarBodyAxis, cU as RadarBodyCurve, cV as RadarMutationOp, cW as RadarValidDiagram, cX as RegionContainmentCertificate, cY as RenderCapabilityError, cZ as RenderOutputDescriptor, c_ as RenderOutputTransports, c$ as RenderedAscii, d0 as RenderedLayout, d1 as RenderedLayoutEdge, d2 as RenderedLayoutGroup, d3 as RenderedLayoutNode, d4 as RenderedRegionKind, d5 as ResolvedPngOutputPolicy, d6 as ResolvedTerminalOutputPolicy, d7 as Result, d8 as RoleStyleFor, d9 as RoleStyleSpec, da as RoleStyles, db as RouteBlocker, dc as RouteCertificate, dd as RouteClass, de as RoutePortAssignment, df as SCENE_CONTRACT_VERSION, dg as SCENE_ROLE_DESCRIPTORS, dh as SCENE_VALIDATION_LIMITS, di as SCENE_VALIDATION_VERSION, dj as SEMANTIC_BINDING_CHANNELS, dk as SHARED_RENDER_OPTION_FIELDS, dl as STYLE_COLOR_TOKEN_DESCRIPTORS, dm as STYLE_SPEC_FIELD_DESCRIPTORS, dn as STYLE_SPEC_FORMAT_VERSION, dp as SceneDoc, dq as SceneNode, dr as SceneRole, ds as SceneValidationDiagnostic, dt as SceneValidationDiagnosticCode, du as SceneValidationError, dv as SceneValidationOptions, dw as SceneValidationResult, dx as SemanticBinding, dy as SemanticBindingChannel, dz as SemanticChannels, dA as SemanticSlots, dB as SequenceBody, dC as SequenceMessage, dD as SequenceMessageStyle, dE as SequenceMutationOp, dF as SequenceParticipant, dG as SequenceValidDiagram, dH as SerializedFlowchartGraph, dI as SourceComment, dJ as SourceMap, dK as SourceMapSpans, dL as SourcePreservationReceipt, dM as SourceSpan, dN as SourceSpanPoint, dO as StateBody, dP as StateMutationOp, dQ as StateNode, dR as StateTransition, dS as StateValidDiagram, dT as StyleBackend, dU as StyleBackendContext, dV as StyleColors, dW as StyleDescriptor, dX as StyleInput, dY as StyleReferenceResolution, dZ as StyleRegistrationOptions, d_ as StyleSpec, d$ as TERMINAL_BOUNDED_PADDING_X, e0 as TERMINAL_DEFAULT_BOX_BORDER_PADDING, e1 as TERMINAL_DEFAULT_PADDING_X, e2 as TERMINAL_DEFAULT_PADDING_Y, e3 as TERMINAL_OUTPUT_POLICY_VERSION, e4 as TEXT_MEASUREMENT_CONTRACT, e5 as TerminalOutputPolicyError, e6 as TerminalOutputPolicyInput, e7 as TextMeasurementContract, e8 as TextMeasurementInput, e9 as TextMeasurementResult, ea as Tier1WarningCode, eb as Tier2WarningCode, ec as TimelineBody, ed as TimelineEvent, ee as TimelineMutationOp, ef as TimelinePeriod, eg as TimelineSection, eh as TimelineValidDiagram, ei as UNREGISTERED_FAMILY_CAPABILITY_STATES, ej as UPSTREAM_MERMAID_FAMILY_INDEX, ek as UpstreamFamilyDescriptor, el as UpstreamHeaderDescriptor, em as UpstreamHeaderMatch, en as UpstreamManifestDiff, eo as UpstreamMermaidFamilyIndex, ep as UpstreamMermaidManifest, eq as ValidDiagram, er as ValidDiagramMeta, es as ValidDiagramPayload, et as VerifyOptions, eu as VerifyResult, ev as WARNING_SEVERITY, ew as WARNING_TIER, ex as WarningCode, ey as WarningSeverity, ez as WarningTier, eA as XyChartAxis, eB as XyChartAxisSpec, eC as XyChartBody, eD as XyChartMutationOp, eE as XyChartSeries, eF as XyChartValidDiagram, eG as asArchitecture, eH as asClass, eI as asEr, eJ as asFlowchart, eK as asGantt, eL as asGitGraph, eM as asJourney, eN as asMindmap, eO as asPie, eP as asQuadrant, eQ as asRadar, eR as asSequence, eS as asState, eT as asTimeline, eU as asXyChart, eV as assertHostedPngRasterBudget, eW as assertPngRasterBudget, eX as assertValidSceneDoc, eY as buildExternalScene, eZ as builtinFamilyMetadata, e_ as classifyMermaidFamilyFromFirstLine, e$ as createExtensionIdentity, f0 as declareFamilyScenePrimitiveEvidence, f1 as detectRegisteredFamilyFromFirstLine, f2 as effectiveFamilyCapabilityState, f3 as err, f4 as findUpstreamFamilyByHeader, f5 as getBackend, f6 as getFamily, f7 as getFamilyConformanceReport, f8 as getStyle, f9 as hostedFontResource, fa as inferBackend, fb as isBuiltinFamilyId, fc as isExternalFamilyId, fd as knownBackendDescriptors, fe as knownBuiltinFamilies, ff as knownFamilies, fg as knownStyleDescriptors, fh as knownStyles, fi as measureText, fj as measureTextWidth, fk as negotiateCapabilities, fl as negotiateRenderCapabilities, fm as normalizePortablePngBackground, fn as ok, fo as omitPngOutputOptions, fp as parseRegisteredMermaid, fq as parseSemVer, fr as pngNapiRuntimeProvenance, fs as pngOutputOptionsJsonSchema, ft as pngRasterDimensions, fu as prepareSvgForPngRasterization, fv as projectNativePngOutputPolicyInput, fw as projectPortablePngOutputOptions, fx as registerBackend, fy as registerStyle, fz as resolvePngOutputPolicy, fA as resolvePortablePngOutputPolicy, fB as resolveSceneRoleTraits, fC as resolveStyleReference, fD as resolveStyleStack, fE as resolveTerminalOutputPolicy, fF as runBackendConformance, fG as sceneRoleTraits, fH as semVerSatisfies, fI as sharedRenderOptionsJsonSchema, fJ as styleInputJsonSchema, fK as styleSpecJsonSchema, fL as svgIntrinsicDimensions, fM as terminalConnectorCapabilityClaims, fN as toFinite, fO as validatePrimitiveCapabilities, fP as validateResourceManifest, fQ as validateSceneDoc, fR as validateSerializableRenderOptions, fS as validateStyleSpec, fT as verifyNoExternalRefs, fU as verifyResourceBytes } from './index-Do8z5rPq.js';
5
5
 
6
6
  interface PngFontWarning {
7
7
  code: 'PNG_FONT_COVERAGE';
package/dist/agent.js CHANGED
@@ -1,11 +1,11 @@
1
1
  import {
2
2
  renderMermaidWithActions
3
- } from "./chunk-3QCXO4V6.js";
3
+ } from "./chunk-KQMJ37OY.js";
4
4
  import {
5
5
  createMermaidPNGRenderer,
6
6
  renderMermaidPNG,
7
7
  renderMermaidPNGWithReceipt
8
- } from "./chunk-GILQUGFK.js";
8
+ } from "./chunk-MBIR6S3B.js";
9
9
  import {
10
10
  ASCII_ROUTE_PARITY_CONTRACT,
11
11
  BOUND_PROVENANCE,
@@ -46,7 +46,7 @@ import {
46
46
  validateOp,
47
47
  verifyMermaid,
48
48
  verifySummary
49
- } from "./chunk-AVCWKYII.js";
49
+ } from "./chunk-BSVM3VMO.js";
50
50
  import {
51
51
  AsciiWidthError,
52
52
  BACKEND_CONFORMANCE_CHECK_IDS,
@@ -204,7 +204,7 @@ import {
204
204
  validateStyleSpec,
205
205
  verifyNoExternalRefs,
206
206
  verifyResourceBytes
207
- } from "./chunk-WHYJLDYG.js";
207
+ } from "./chunk-XVY324NY.js";
208
208
  export {
209
209
  ASCII_ROUTE_PARITY_CONTRACT,
210
210
  AsciiWidthError,
@@ -1,11 +1,11 @@
1
1
  #!/usr/bin/env node
2
2
  import {
3
3
  runMcpCli
4
- } from "./chunk-HFD4MALA.js";
5
- import "./chunk-UJNY65QS.js";
6
- import "./chunk-GILQUGFK.js";
7
- import "./chunk-AVCWKYII.js";
8
- import "./chunk-WHYJLDYG.js";
4
+ } from "./chunk-FGO3J7RA.js";
5
+ import "./chunk-JJ7JRYZV.js";
6
+ import "./chunk-MBIR6S3B.js";
7
+ import "./chunk-BSVM3VMO.js";
8
+ import "./chunk-XVY324NY.js";
9
9
 
10
10
  // src/mcp/mcp-bin.ts
11
11
  var code = await runMcpCli(process.argv.slice(2));
package/dist/am.js CHANGED
@@ -1,11 +1,11 @@
1
1
  #!/usr/bin/env node
2
- import "./chunk-3QCXO4V6.js";
2
+ import "./chunk-KQMJ37OY.js";
3
3
  import {
4
4
  projectRenderErrorDiagnostic
5
- } from "./chunk-UJNY65QS.js";
5
+ } from "./chunk-JJ7JRYZV.js";
6
6
  import {
7
7
  renderMermaidPNGWithReceipt
8
- } from "./chunk-GILQUGFK.js";
8
+ } from "./chunk-MBIR6S3B.js";
9
9
  import {
10
10
  configWarningsForMermaid,
11
11
  describeMermaid,
@@ -19,7 +19,7 @@ import {
19
19
  renderMermaidSVG,
20
20
  renderMermaidSVGWithReceipt,
21
21
  verifyMermaid
22
- } from "./chunk-AVCWKYII.js";
22
+ } from "./chunk-BSVM3VMO.js";
23
23
  import {
24
24
  BACKEND_CONFORMANCE_VERSION,
25
25
  BUILTIN_FAMILY_METADATA,
@@ -82,7 +82,7 @@ import {
82
82
  synthesizeFromGraph,
83
83
  validateSerializableRenderOptions,
84
84
  validateStyleSpec
85
- } from "./chunk-WHYJLDYG.js";
85
+ } from "./chunk-XVY324NY.js";
86
86
 
87
87
  // src/cli/index.ts
88
88
  import { readFileSync as readFileSync2, existsSync as existsSync2, writeFileSync as writeFileSync2, mkdtempSync, statSync, watch } from "fs";
@@ -34552,7 +34552,7 @@ function toJsonSafe(d) {
34552
34552
  // src/cli/run-entrypoint.ts
34553
34553
  async function runAmCli(argv) {
34554
34554
  if (argv[0] === "mcp") {
34555
- const { runMcpCli } = await import("./mcp-cli-SJVOGRA6.js");
34555
+ const { runMcpCli } = await import("./mcp-cli-7FLGTEG3.js");
34556
34556
  return runMcpCli(argv.slice(1));
34557
34557
  }
34558
34558
  return runCli(argv);
@@ -0,0 +1,31 @@
1
+ import{a as Ye}from"./chunk-STQRDZ67.js";import"./chunk-GRXCKTHX.js";import{c as De}from"./chunk-CTVVJPMX.js";import"./chunk-PXRUFH7U.js";import{a as Oe}from"./chunk-M6BT2HIP.js";import{a as K}from"./chunk-PZEWZT35.js";import{a as Ue}from"./chunk-I6VE56S7.js";import{b as Te,c as Ee,e as Ce}from"./chunk-FLD63DXE.js";import{a as fe,j as te,k as ze}from"./chunk-RVO6J7S3.js";import{a as Le,b as _e,c as Fe}from"./chunk-EPFMQPXX.js";import{H as Be,I as We,L as re,N as me,O as H,P as ie,Q as je,fa as Ge,i as Ie,ia as U,ja as xe,ka as oe,la as ye,na as Ne,oa as Xe,pa as ce,qa as He,xa as Ve}from"./chunk-FXBBGAMJ.js";import{f as ne}from"./chunk-P7HMSKHJ.js";var St=Object.freeze({id:"architecture",upstreamId:"architecture",maturity:"stable",label:"Architecture",headers:["architecture","architecture-beta"],aliases:[],config:{section:"architecture",keys:["padding","iconSize","fontSize","nodeSeparation","idealEdgeLengthMultiplier","edgeElasticity","numIter","seed","randomize"],noopKeys:["edgeElasticity","numIter","randomize","seed"]},identity:{id:"family:architecture",kind:"family",version:"1.0.0",compatibility:{core:"^0.3.0"},provenance:{owner:"agentic-mermaid",source:"built-in"}},collisionPriority:100,semanticChannels:[],semanticRoles:["prelude","defs","chrome","title","group","group-header","icon","label","service","junction","edge"],scenePrimitiveEvidence:[{role:"prelude",primitive:"document",applicability:"applicable",realization:"native",evidence:["src/__tests__/section-a-family-descriptor-conformance.test.ts"]},{role:"defs",primitive:"document",applicability:"applicable",realization:"native",evidence:["src/__tests__/section-a-family-descriptor-conformance.test.ts"]},{role:"defs",primitive:"marker",applicability:"applicable",realization:"native",evidence:["src/__tests__/section-a-family-descriptor-conformance.test.ts"]},{role:"chrome",primitive:"document",applicability:"applicable",realization:"native",evidence:["src/__tests__/section-a-family-descriptor-conformance.test.ts"]},{role:"chrome",primitive:"shape",applicability:"applicable",realization:"native",evidence:["src/__tests__/section-a-family-descriptor-conformance.test.ts"]},{role:"title",primitive:"text",applicability:"applicable",realization:"native",evidence:["src/__tests__/section-a-family-descriptor-conformance.test.ts"]},{role:"group",primitive:"shape",applicability:"applicable",realization:"native",evidence:["src/__tests__/section-a-family-descriptor-conformance.test.ts"]},{role:"group",primitive:"container",applicability:"applicable",realization:"native",evidence:["src/__tests__/section-a-family-descriptor-conformance.test.ts"]},{role:"group-header",primitive:"shape",applicability:"applicable",realization:"native",evidence:["src/__tests__/section-a-family-descriptor-conformance.test.ts"]},{role:"icon",primitive:"document",applicability:"applicable",realization:"native",evidence:["src/__tests__/section-a-family-descriptor-conformance.test.ts"]},{role:"label",primitive:"text",applicability:"applicable",realization:"native",evidence:["src/__tests__/section-a-family-descriptor-conformance.test.ts"]},{role:"service",primitive:"shape",applicability:"applicable",realization:"native",evidence:["src/__tests__/section-a-family-descriptor-conformance.test.ts"]},{role:"service",primitive:"container",applicability:"applicable",realization:"native",evidence:["src/__tests__/section-a-family-descriptor-conformance.test.ts"]},{role:"junction",primitive:"shape",applicability:"applicable",realization:"native",evidence:["src/__tests__/section-a-family-descriptor-conformance.test.ts"]},{role:"junction",primitive:"container",applicability:"applicable",realization:"native",evidence:["src/__tests__/section-a-family-descriptor-conformance.test.ts"]},{role:"edge",primitive:"connector",applicability:"applicable",realization:"native",evidence:["src/__tests__/section-a-family-descriptor-conformance.test.ts"]}],example:`architecture-beta
2
+ group backend(cloud)[Backend]
3
+ service api(server)[API] in backend
4
+ service db(database)[Database] in backend
5
+ service cache(disk)[Cache] in backend
6
+ api:R --> L:db
7
+ api:B -[reads]-> T:cache`,detect:e=>/^architecture(?:-beta)?\s*$/.test(e),detectLoose:e=>/^architecture(?:-beta)?(?:\s|$)/.test(e)}),Je=St;var de=36,be=56,$t=1.5,W={groupHeaderHeight:28,groupFontSize:12,groupFontWeight:600,groupLetterSpacing:0,groupPaddingX:16,groupPaddingY:16,groupLabelPaddingX:12,groupCornerRadius:0,groupLineWidth:1,serviceFontSize:13,serviceFontWeight:500,serviceLetterSpacing:0,servicePaddingX:20,servicePaddingY:10,serviceCornerRadius:0,serviceLineWidth:1,edgeFontSize:11,edgeFontWeight:400,edgeLetterSpacing:0,edgeLineWidth:1,edgeBendRadius:0,iconSize:16,serviceIconSize:18,junctionOuterRadius:8,junctionInnerRadius:4.5};function Qe(e,t,r={},n){let o=Ke(e,"themeVariables"),a=Ke(e,"architecture"),l=Q(ae(a,"fontSize")??ae(e,"fontSize")??ae(o,"fontSize")??W.serviceFontSize,10,24),s=Q(ae(a,"iconSize")??W.serviceIconSize,12,40),d=Q(Math.round(s*(W.iconSize/W.serviceIconSize)),10,36),c=Q(Math.round(l*.92),10,22),v=Q(Math.round(l*.85),10,20),m=Math.max(W.groupHeaderHeight,Math.round(Math.max(c,d)+12)),A=Q(Math.round(s*.44),8,18),p=Number((A*.56).toFixed(1)),f={nodeLabelFontSize:l,edgeLabelFontSize:v,groupHeaderFontSize:c,nodeLabelFontWeight:W.serviceFontWeight,edgeLabelFontWeight:W.edgeFontWeight,groupHeaderFontWeight:W.groupFontWeight,nodePaddingX:W.servicePaddingX,nodePaddingY:W.servicePaddingY,nodeCornerRadius:W.serviceCornerRadius,nodeLineWidth:W.serviceLineWidth,edgeLineWidth:W.edgeLineWidth,edgeBendRadius:W.edgeBendRadius,groupCornerRadius:W.groupCornerRadius,groupPaddingX:W.groupPaddingX,groupPaddingY:W.groupPaddingY,groupLabelPaddingX:W.groupLabelPaddingX,groupLineWidth:W.groupLineWidth},u=ze(r,f,n),b={...{groupHeaderHeight:Math.max(m,u.groupHeaderFontSize+12),groupFontSize:u.groupHeaderFontSize,groupFontWeight:u.groupHeaderFontWeight,groupLetterSpacing:u.groupLetterSpacing,groupFont:u.groupFont,groupTextTransform:u.groupTextTransform,groupPaddingX:u.groupPaddingX,groupPaddingY:u.groupPaddingY,groupLabelPaddingX:u.groupLabelPaddingX,groupCornerRadius:u.groupCornerRadius,groupLineWidth:u.groupLineWidth,serviceFontSize:u.nodeLabelFontSize,serviceFontWeight:u.nodeLabelFontWeight,serviceLetterSpacing:u.nodeLetterSpacing,serviceTextTransform:u.nodeTextTransform,servicePaddingX:u.nodePaddingX,servicePaddingY:u.nodePaddingY,serviceCornerRadius:u.cornerRadius??0,serviceLineWidth:u.nodeLineWidth,edgeFontSize:u.edgeLabelFontSize,edgeFontWeight:u.edgeLabelFontWeight,edgeLetterSpacing:u.edgeLetterSpacing,edgeTextTransform:u.edgeTextTransform,edgeLineWidth:u.lineWidth,edgeBendRadius:u.edgeBendRadius,iconSize:d,serviceIconSize:s,junctionOuterRadius:A,junctionInnerRadius:p,groupSurface:u.groupFillColor??se(o,"clusterBkg")??t.surface,groupHeaderSurface:u.groupHeaderFillColor,groupBorder:u.groupBorderColor??se(o,"clusterBorder")??t.border,groupText:u.groupTextColor,serviceSurface:u.nodeFillColor??se(o,"mainBkg","secondaryColor")??t.surface,serviceBorder:u.nodeBorderColor??se(o,"primaryBorderColor")??t.border,serviceText:u.nodeTextColor,edgeStroke:u.edgeStrokeColor,edgeText:u.edgeTextColor},...r.architecture?.visual};if(b.junctionInnerRadius>b.junctionOuterRadius)throw new RangeError("architecture.visual.junctionInnerRadius must not exceed junctionOuterRadius");return{visual:b,layout:Rt(b),padding:Tt(a,"padding"),nodeSpacing:Mt(a),layerSpacing:kt(a)}}function Mt(e){let t=ue(e,"nodeSeparation");if(!(t===void 0||!Number.isFinite(t)||t<0))return Q(Math.round(t),0,512)}function kt(e){let t=ue(e,"idealEdgeLengthMultiplier");if(!(t===void 0||!Number.isFinite(t)||t<=0))return Q(Math.round(be*t/$t),8,512)}function Rt(e){return{groupFontSize:e.groupFontSize,groupFontWeight:e.groupFontWeight,groupLetterSpacing:e.groupLetterSpacing,groupFont:e.groupFont,groupTextTransform:e.groupTextTransform,groupPaddingX:e.groupPaddingX,groupPaddingY:e.groupPaddingY,groupCornerRadius:e.groupCornerRadius,groupLineWidth:e.groupLineWidth,serviceFontSize:e.serviceFontSize,serviceFontWeight:e.serviceFontWeight,serviceLetterSpacing:e.serviceLetterSpacing,serviceTextTransform:e.serviceTextTransform,servicePaddingX:e.servicePaddingX,servicePaddingY:e.servicePaddingY,serviceCornerRadius:e.serviceCornerRadius,serviceLineWidth:e.serviceLineWidth,edgeFontSize:e.edgeFontSize,edgeFontWeight:e.edgeFontWeight,edgeLetterSpacing:e.edgeLetterSpacing,edgeTextTransform:e.edgeTextTransform,edgeLineWidth:e.edgeLineWidth,edgeBendRadius:e.edgeBendRadius}}function se(e,...t){for(let r of t){let n=Pt(e,r);if(n)return n}}function Pt(e,t){let r=e?.[t];return typeof r=="string"?r:void 0}function ue(e,t){return Et(e?.[t])}function ae(e,t){let r=ue(e,t);return r!==void 0&&r>0?r:void 0}function Tt(e,t){let r=ue(e,t);return r!==void 0&&r>=0?r:void 0}function Ke(e,t){let r=e?.[t];return Ct(r)?r:void 0}function Et(e){if(typeof e=="number")return e;if(typeof e!="string")return;let t=e.trim();return t.match(/^[+-]?(?:\d+(?:\.\d+)?|\.\d+)(?:px)?$/i)?Number.parseFloat(t):void 0}function Q(e,t,r){return Math.min(r,Math.max(t,e))}function Ct(e){return!!e&&typeof e=="object"&&!Array.isArray(e)}var qe=/^align(?:\s|$)/,Lt=/^[\w-]+$/;function Ze(e){let t=e.trim().split(/\s+/),r=t[1];if(r!=="row"&&r!=="column")return{ok:!1,reason:`expected "align row" or "align column", got "${r??""}"`};let n=t.slice(2);if(n.length<2)return{ok:!1,reason:"an align directive needs at least two members"};let o=new Set;for(let a of n){if(!Lt.test(a))return{ok:!1,reason:`align member "${a}" must match [A-Za-z0-9_-]+`};if(o.has(a))return{ok:!1,reason:`align member "${a}" is listed twice`};o.add(a)}return{ok:!0,alignment:{axis:r,members:n}}}var q="[\\w-]+",tt="\\(([^)]+)\\)",rt="\\[(.+)\\]",_t=new RegExp(`^group\\s+(${q})(?:${tt})?(?:${rt})?(?:\\s+in\\s+(${q}))?\\s*$`),Ft=new RegExp(`^service\\s+(${q})(?:${tt})?(?:${rt})?(?:\\s+in\\s+(${q}))?\\s*$`),It=new RegExp(`^junction\\s+(${q})(?:\\s+in\\s+(${q}))?\\s*$`),zt=new RegExp(`^(${q})(\\{group\\})?:(L|R|T|B)$`),Bt=new RegExp(`^(L|R|T|B):(${q})(\\{group\\})?$`);function nt(e){let t=Te(e);if(Ee(t),e=t.familyLines,e.length===0)throw new Error("Empty mermaid diagram");if(!/^architecture(?:-beta)?\s*$/i.test(e[0]))throw new Error(`Invalid mermaid header: "${e[0]}". Expected "architecture" or "architecture-beta".`);let r=new Map,n=new Map,o=new Map,a=[],l=[],s=[],d,c=t.accessibility.title===void 0?void 0:re(t.accessibility.title),v=t.accessibility.descr===void 0?void 0:re(t.accessibility.descr);for(let m=1;m<e.length;m++){let A=e[m],p=A.match(/^title\s+(.+)$/i);if(p){d=re(p[1].trim());continue}let f=A.match(_t);if(f){let b=f[1],S=f[2]?.trim()||void 0,L=re(f[3]??b),g=f[4]??void 0;ve(b,r,n,o);let i={id:b,label:L,icon:S,parentId:g,children:[]};Ae(g,r,A),r.set(b,i),we({kind:"group",id:b},g,r,a);continue}let u=A.match(Ft);if(u){let b=u[1],S=u[2]?.trim()||void 0,L=re(Dt(u[3],b)),g=u[4]??void 0;ve(b,r,n,o);let i={id:b,label:L,icon:S,parentId:g};Ae(g,r,A),n.set(b,i),we({kind:"service",id:b},g,r,a);continue}let w=A.match(It);if(w){let b=w[1],S=w[2]??void 0;ve(b,r,n,o);let L={id:b,parentId:S};Ae(S,r,A),o.set(b,L),we({kind:"junction",id:b},S,r,a);continue}if(qe.test(A)){s.push(Wt(A,r,n,o));continue}l.push(jt(A,n,o))}return{title:d,groups:[...r.values()],services:[...n.values()],junctions:[...o.values()],edges:l,alignments:s,rootChildren:a,accessibilityTitle:c,accessibilityDescription:v}}function Wt(e,t,r,n){let o=Ze(e);if(!o.ok)throw K({what:`Invalid architecture align directive "${e}" \u2014 ${o.reason}`,expectedForm:"align row|column memberA memberB ..., listing at least two distinct services or junctions",example:"align row db1 db2 db3"});for(let a of o.alignment.members)if(!(r.has(a)||n.has(a)))throw t.has(a)?new Error(`Architecture align members must be services or junctions; "${a}" is a group in line "${e}"`):K({what:`Unknown architecture align member "${a}" in line "${e}"`,expectedForm:"a service or junction declared earlier",example:`service ${a}(server)[${a}]`,known:[...r.keys(),...n.keys()]});return o.alignment}function Dt(e,t){return e??t}function ve(e,t,r,n){if(t.has(e)||r.has(e)||n.has(e))throw K({what:`Duplicate architecture identifier "${e}"`,expectedForm:"a unique id for each service, group, and junction",example:`${e}2`,known:[...t.keys(),...r.keys(),...n.keys()]})}function Ae(e,t,r){if(e&&!t.has(e))throw K({what:`Unknown architecture group "${e}" in line "${r}"`,expectedForm:"a group declared earlier with group id(icon)[Label]",example:`group ${e}(cloud)[${e}]`,known:[...t.keys()]})}function we(e,t,r,n){t?r.get(t).children.push(e):n.push(e)}function jt(e,t,r){let n=e.match(/^(\S+)\s+(.+)\s+(\S+)$/);if(!n)throw K({what:`Invalid architecture edge: "${e}"`,expectedForm:"source:SIDE <op> SIDE:target, where SIDE is L, R, T, or B",example:"api:R --> L:db"});let o=Ot(n[1]),a=Gt(n[3]),{label:l,hasArrowStart:s,hasArrowEnd:d}=Nt(n[2]);return et(o,t,r,e),et(a,t,r,e),{source:o,target:a,label:l,hasArrowStart:s,hasArrowEnd:d}}function Ot(e){let t=e.trim().match(zt);if(!t)throw new Error(`Invalid architecture edge source "${e}" \u2014 expected id then side, e.g. "api:R" in "api:R -- L:db"`);return{id:t[1],boundary:t[2]?"group":"item",side:t[3]}}function Gt(e){let t=e.trim().match(Bt);if(!t)throw new Error(`Invalid architecture edge target "${e}" \u2014 expected side then id, e.g. "L:db" in "api:R -- L:db"`);return{id:t[2],boundary:t[3]?"group":"item",side:t[1]}}function Nt(e){let t=e.trim();if(t==="<-->")return{hasArrowStart:!0,hasArrowEnd:!0};if(t==="-->")return{hasArrowStart:!1,hasArrowEnd:!0};if(t==="<--")return{hasArrowStart:!0,hasArrowEnd:!1};if(t==="--")return{hasArrowStart:!1,hasArrowEnd:!1};let r=t.match(/^(<)?-\[(.*)\]-(>)?$/);if(!r)throw K({what:`Invalid architecture edge operator "${e}"`,expectedForm:"one of --, -->, <--, <-->, or -[label]-",example:"api:R --> L:db"});return{label:re(r[2]??"").trim()||void 0,hasArrowStart:!!r[1],hasArrowEnd:!!r[3]}}function et(e,t,r,n){let o=t.get(e.id),a=r.get(e.id);if(!o&&!a)throw K({what:`Unknown architecture item "${e.id}" in line "${n}"`,expectedForm:"a service or junction declared earlier",example:`service ${e.id}(server)[${e.id}]`,known:[...t.keys(),...r.keys()]});if(e.boundary==="group"){if(!o)throw new Error(`Architecture group boundary modifier only applies to services: "${n}"`);if(!o.parentId)throw new Error(`Service "${o.id}" is not inside a group, so "{group}" is invalid in line "${n}"`)}}function it(e){let t=new Map;for(let n of e.services)t.set(n.id,{id:n.id,label:n.label,shape:n.icon?"service":"rectangle"});for(let n of e.junctions)t.set(n.id,{id:n.id,label:"",shape:"state-start"});return{direction:Ht(e.edges),nodes:t,edges:e.edges.map(n=>({source:n.source.id,target:n.target.id,label:n.label,style:"solid",hasArrowStart:n.hasArrowStart,hasArrowEnd:n.hasArrowEnd})),subgraphs:Xt(e.groups),classDefs:new Map,classAssignments:new Map,nodeStyles:new Map,linkStyles:new Map}}function Xt(e){let t=new Map(e.map(n=>[n.id,n]));function r(n){let o=[],a=[];for(let l of n.children)if(l.kind==="group"){let s=t.get(l.id);s&&a.push(r(s))}else o.push(l.id);return{id:n.id,label:n.label,nodeIds:o,children:a}}return e.filter(n=>!n.parentId).map(r)}function Ht(e){let t=0,r=0;for(let n of e)n.source.side==="L"||n.source.side==="R"?t++:r++,n.target.side==="L"||n.target.side==="R"?t++:r++;return t>=r?"LR":"TD"}var Se=16,N=18,ot=18,Vt=600,ct=20,Yt=40;function lt(e,t={},r){let n=it(e),o=De(n,{padding:t.padding??40,nodeSpacing:t.nodeSpacing??de,layerSpacing:t.layerSpacing??be,preserveSubgraphChildOrder:!0,styleFace:r?{node:{fontSize:r.serviceFontSize,fontWeight:r.serviceFontWeight,letterSpacing:r.serviceLetterSpacing,textTransform:r.serviceTextTransform,paddingX:r.servicePaddingX,paddingY:r.servicePaddingY,cornerRadius:r.serviceCornerRadius,lineWidth:r.serviceLineWidth},edge:{fontSize:r.edgeFontSize,fontWeight:r.edgeFontWeight,letterSpacing:r.edgeLetterSpacing,textTransform:r.edgeTextTransform,lineWidth:r.edgeLineWidth,bendRadius:r.edgeBendRadius},group:{fontSize:r.groupFontSize,fontWeight:r.groupFontWeight,letterSpacing:r.groupLetterSpacing,fontFamily:r.groupFont,textTransform:r.groupTextTransform,paddingX:r.groupPaddingX,paddingY:r.groupPaddingY,cornerRadius:r.groupCornerRadius,lineWidth:r.groupLineWidth}}:void 0}),a=new Map(e.services.map(i=>[i.id,i])),l=new Map(e.groups.map(i=>[i.id,i])),s=new Set(e.junctions.map(i=>i.id)),d=[],c=[],v=new Map,m=new Map;for(let i of o.nodes){let x={x:i.x,y:i.y,width:i.width,height:i.height};if(a.has(i.id)){let P=a.get(i.id);d.push({...x,id:P.id,label:P.label,icon:P.icon,parentId:P.parentId}),v.set(i.id,x)}else if(s.has(i.id)){let P=e.junctions.find(h=>h.id===i.id);c.push({...x,id:P.id,parentId:P.parentId}),m.set(i.id,x)}}let A=new Map(e.services.map((i,x)=>[i.id,x]));d.sort((i,x)=>+!!i.parentId-+!!x.parentId||(A.get(i.id)??0)-(A.get(x.id)??0)),Ut(e,d,c,t.nodeSpacing??de);for(let i of d)v.set(i.id,i);for(let i of c)m.set(i.id,i);let p=new Map,f=o.groups.map(i=>gt(i,l,p));ge(f,d,c,e.alignments.length>0);let u=Jt(e,d,c,p,t.nodeSpacing??de);if(u){ge(f,d,c,!0);for(let i of d)v.set(i.id,i);for(let i of c)m.set(i.id,i)}let w=new Map(c.map(i=>[i.id,i])),b=e.edges.map(i=>Kt(i,a,v,m,p,d,w));Zt(b,d,r);let S=e.title?te(e.title,r?.groupTextTransform):void 0,L=o.width,g=o.height;(e.alignments.length>0||u)&&(L=Math.max(80,...d.map(i=>i.x+i.width+40),...c.map(i=>i.x+i.width+40),...f.map(i=>i.x+i.width+40)),g=Math.max(80,...d.map(i=>i.y+i.height+40),...c.map(i=>i.y+i.height+40),...f.map(i=>i.y+i.height+40))),S&&(L=Math.max(L,fe(S,r?.groupFontSize??ot,r?.groupFontWeight??Vt)+Yt*2),g=Math.max(g,ct+ot+20));for(let i of b){for(let x of i.points)L=Math.max(L,x.x+40),g=Math.max(g,x.y+40);i.labelPosition&&(L=Math.max(L,i.labelPosition.x+72),g=Math.max(g,i.labelPosition.y+28))}return{width:L,height:g,...S?{title:{text:S,x:L/2,y:ct}}:{},groups:f,services:d,junctions:c,edges:b,accessibilityTitle:e.accessibilityTitle,accessibilityDescription:e.accessibilityDescription}}function Ut(e,t,r,n){let o=new Map;for(let p of t)o.set(p.id,p);for(let p of r)o.set(p.id,p);let a=new Set(e.alignments.filter(p=>p.axis==="row").flatMap(p=>p.members)),l=[...e.alignments.filter(p=>p.axis==="row"),...e.alignments.filter(p=>p.axis==="column")];for(let p of l){let f=p.members.map(u=>o.get(u)).filter(u=>u!==void 0);if(!(f.length<2))if(p.axis==="row"){let u=Math.min(...f.map(b=>b.y+b.height/2)),w=Math.min(...f.map(b=>b.x));for(let b of f)b.x=w,b.y=u-b.height/2,w+=b.width+n}else{let u=Math.min(...f.map(S=>S.x+S.width/2)),w=f.every(S=>!a.has(S.id)),b=Math.min(...f.map(S=>S.y));for(let S of f)S.x=u-S.width/2,w&&(S.y=b,b+=S.height+n)}}let s=new Map,d=p=>{let f=s.get(p)??p;if(f===p)return s.set(p,p),p;let u=d(f);return s.set(p,u),u},c=(p,f)=>{let u=d(p),w=d(f);u!==w&&s.set(w,u)};for(let p of e.alignments)if(p.axis==="column")for(let f=1;f<p.members.length;f++)c(p.members[0],p.members[f]);for(let p of e.alignments){if(p.axis!=="row")continue;let f=p.members.map(w=>o.get(w)).filter(w=>w!==void 0),u=-1/0;for(let w of f){if(w.x<u){let b=u-w.x,S=d(w.id);for(let L of o.values())d(L.id)===S&&(L.x+=b)}u=w.x+w.width+n}}let v=new Map,m=p=>{let f=v.get(p)??p;if(f===p)return v.set(p,p),p;let u=m(f);return v.set(p,u),u},A=(p,f)=>{let u=m(p),w=m(f);u!==w&&v.set(w,u)};for(let p of e.alignments)if(p.axis==="row")for(let f=1;f<p.members.length;f++)A(p.members[0],p.members[f]);for(let p=0;p<2;p++)for(let f of e.alignments){if(f.axis!=="row")continue;let u=f.members.map(i=>o.get(i)).filter(i=>i!==void 0);if(u.length<2)continue;let w=m(u[0].id),b=Math.min(...u.map(i=>i.x)),S=Math.max(...u.map(i=>i.x+i.width)),L=Math.min(...u.map(i=>i.y)),g=Math.max(...u.map(i=>i.y+i.height));for(let i of o.values()){if(m(i.id)===w||!(i.x<S&&i.x+i.width>b&&i.y<g&&i.y+i.height>L))continue;let P=m(i.id),h=[...o.values()].filter(T=>m(T.id)===P),y=Math.min(...h.map(T=>T.y)),$=g+n-y;for(let T of h)T.y+=$}}}function Jt(e,t,r,n,o){let a=!1,l=new Map(e.groups.map(h=>[h.id,h])),s=new Map(e.services.map(h=>[h.id,h])),d=new Map(e.junctions.map(h=>[h.id,h])),c=new Map(t.map(h=>[h.id,h])),v=new Map(r.map(h=>[h.id,h])),m=(h,y)=>`${h}:${y}`,A=h=>{let y=h.indexOf(":");return{kind:h.slice(0,y),id:h.slice(y+1)}},p=h=>{let y=[],$=h;for(;$;)y.push(m("group",$)),$=l.get($)?.parentId;return y.reverse()},f=(h,y="item")=>{let $=s.get(h);if($){let O=p($.parentId);return y==="group"?O:[...O,m("service",h)]}let T=d.get(h);return T?[...p(T.parentId),m("junction",h)]:null},u=[];for(let h of e.edges){let y=f(h.source.id,h.source.boundary),$=f(h.target.id,h.target.boundary);if(!y||!$)continue;let T=0;for(;T<y.length&&T<$.length&&y[T]===$[T];)T++;if(T>=y.length||T>=$.length)continue;let O=T===0?void 0:A(y[T-1]).id,D=y[T],j=$[T],V=(G,R,C)=>{let _=C==="L"||C==="R"?"x":"y",F=C==="R"||C==="B";u.push({axis:_,parentId:O,before:F?G:R,after:F?R:G,depth:T})};V(D,j,h.source.side),V(j,D,h.target.side)}let w=h=>h?l.get(h)?.children??[]:e.rootChildren,b=h=>{let{kind:y,id:$}=A(h);return y==="group"?n.get($):y==="service"?c.get($):v.get($)},S=(h,y,$)=>{if(Math.abs($)<=I)return;let{kind:T,id:O}=A(h);if(T==="service"){let j=c.get(O);j&&(j[y]+=$);return}if(T==="junction"){let j=v.get(O);j&&(j[y]+=$);return}let D=j=>{let V=n.get(j);V&&(V[y]+=$);for(let G of l.get(j)?.children??[])G.kind==="group"?D(G.id):S(m(G.kind,G.id),y,$)};D(O)},L=[...n.values()].filter(h=>!h.parentId),g=new Map;for(let h of u){let y=`${h.depth}:${h.parentId??""}:${h.axis}`,$=g.get(y)??[];$.push(h),g.set(y,$)}let i=[...g.values()].sort((h,y)=>y[0].depth-h[0].depth||ne(h[0].parentId??"",y[0].parentId??"")||ne(h[0].axis,y[0].axis));for(let h of i){let{axis:y,parentId:$}=h[0],T=w($).map(M=>m(M.kind,M.id)).filter(M=>b(M)!==void 0);if(T.length<2)continue;let O=new Map(T.map(M=>[M,M])),D=M=>{let E=O.get(M)??M;if(E===M)return E;let k=D(E);return O.set(M,k),k},j=(M,E)=>{let k=D(M),B=D(E);k!==B&&O.set(B,k<B?k:B)},V=y==="x"?"column":"row";for(let M of e.alignments){if(M.axis!==V)continue;let E=M.members.map(k=>{let B=f(k);if(!B)return;if(!$)return B[0];let J=m("group",$),ee=B.indexOf(J);return ee>=0?B[ee+1]:void 0}).filter(k=>k!==void 0&&O.has(k));for(let k=1;k<E.length;k++)j(E[0],E[k])}let G=new Map;for(let M of T){let E=D(M),k=G.get(E)??[];k.push(M),G.set(E,k)}let R=M=>{let E=G.get(M).map(X=>b(X)),k=Math.min(...E.map(X=>X.x)),B=Math.min(...E.map(X=>X.y)),J=Math.max(...E.map(X=>X.x+X.width)),ee=Math.max(...E.map(X=>X.y+X.height));return{x:k,y:B,width:J-k,height:ee-B}},C=new Map,_=!1;for(let M of h){let E=D(M.before),k=D(M.after);if(E===k){_=!0;break}let B=C.get(E)??new Set;B.add(k),C.set(E,B)}if(_)continue;let F=[...G.keys()],Z=(M,E)=>{let k=R(M),B=R(E);return y==="x"?k.x+k.width+o<=B.x+I:k.y+k.height+o<=B.y+I};if([...C].every(([M,E])=>[...E].every(k=>Z(M,k))))continue;let Y=new Map(F.map(M=>[M,0]));for(let M of C.values())for(let E of M)Y.set(E,(Y.get(E)??0)+1);let z=[];for(;z.length<F.length;){let M=F.filter(k=>!z.includes(k)&&Y.get(k)===0).sort((k,B)=>{let J=R(k),ee=R(B);return(y==="x"?J.x-ee.x:J.y-ee.y)||ne(k,B)});if(M.length===0)break;let E=M[0];z.push(E);for(let k of C.get(E)??[])Y.set(k,Y.get(k)-1)}if(z.length!==F.length)continue;let wt=F.map(R),Pe=Math.min(...wt.map(M=>y==="x"?M.x:M.y));for(let M of z){let E=R(M),k=y==="x"?E.x:E.y,B=Pe-k;Math.abs(B)>I&&(a=!0);for(let J of G.get(M))S(J,y,B);Pe+=(y==="x"?E.width:E.height)+o}ge(L,t,r,!0)}let x=[...e.groups.map(h=>({parentId:h.id,depth:p(h.id).length})),{parentId:void 0,depth:0}].sort((h,y)=>y.depth-h.depth||ne(h.parentId??"",y.parentId??"")),P=(h,y)=>h.x<y.x+y.width-I&&y.x<h.x+h.width-I&&h.y<y.y+y.height-I&&y.y<h.y+h.height-I;for(let h of x){let y=w(h.parentId).map(R=>m(R.kind,R.id)).filter(R=>b(R)!==void 0);if(y.length<2)continue;let $=new Map(y.map(R=>[R,R])),T=R=>{let C=$.get(R)??R;if(C===R)return C;let _=T(C);return $.set(R,_),_},O=(R,C)=>{let _=T(R),F=T(C);_!==F&&$.set(F,_<F?_:F)};for(let R of e.alignments){if(R.axis!=="row")continue;let C=R.members.map(_=>{let F=f(_);if(!F)return;if(!h.parentId)return F[0];let Z=F.indexOf(m("group",h.parentId));return Z>=0?F[Z+1]:void 0}).filter(_=>_!==void 0&&$.has(_));for(let _=1;_<C.length;_++)O(C[0],C[_])}let D=new Map;for(let R of y){let C=T(R),_=D.get(C)??[];_.push(R),D.set(C,_)}let j=R=>{let C=D.get(R).map(z=>b(z)),_=Math.min(...C.map(z=>z.x)),F=Math.min(...C.map(z=>z.y)),Z=Math.max(...C.map(z=>z.x+z.width)),Y=Math.max(...C.map(z=>z.y+z.height));return{x:_,y:F,width:Z-_,height:Y-F}},V=[...D.keys()].sort((R,C)=>{let _=j(R),F=j(C);return _.y-F.y||_.x-F.x||ne(R,C)}),G=[];for(let R of V){for(let C=0;C<=G.length;C++){let _=j(R),F=G.map(j).filter(z=>P(_,z));if(F.length===0)break;let Y=Math.max(...F.map(z=>z.y+z.height+o))-_.y;for(let z of D.get(R))S(z,"y",Y);a=!0}G.push(R)}ge(L,t,r,!0)}return a}function gt(e,t,r){let n=t.get(e.id),o={id:e.id,label:n?.label??e.id,icon:n?.icon,parentId:n?.parentId,x:e.x,y:e.y,width:e.width,height:e.height,children:e.children.map(a=>gt(a,t,r))};return r.set(o.id,o),o}function ge(e,t,r,n){for(let o of e)pt(o,t,r,n)}function pt(e,t,r,n){let o=[];for(let c of e.children)o.push(pt(c,t,r,n));for(let c of t)c.parentId===e.id&&o.push(c);for(let c of r)c.parentId===e.id&&o.push(c);if(o.length===0)return e;let a=Math.min(e.x,...o.map(c=>c.x-N)),l=Math.min(e.y,...o.map(c=>c.y-N)),s=Math.max(e.x+e.width,...o.map(c=>c.x+c.width+N)),d=n?Math.max(e.y+48,...o.map(c=>c.y+c.height+N)):Math.max(e.y+e.height,...o.map(c=>c.y+c.height+N));return e.x=a,e.y=l,e.width=s-a,e.height=d-l,e}function Kt(e,t,r,n,o,a,l){let s=dt(e.source,t,r,n,o),d=dt(e.target,t,r,n,o),c=Qt(e,t,o,a,l),v=ke([s.exit,...nr(s.exit,d.exit,e.source.side,e.target.side),d.exit]),m=at(v,c)?v:qt(s.exit,d.exit,c)??v,A=ke([s.anchor,...m,d.anchor]),p=st(s.anchor,e.source.side,d.anchor),f=st(d.anchor,e.target.side,s.anchor);return{source:e.source,target:e.target,label:e.label,hasArrowStart:e.hasArrowStart,hasArrowEnd:e.hasArrowEnd,points:A,labelPosition:e.label?ir(A):void 0,placement:p&&f?"satisfied":"conflicted",sourceFacesTarget:p,targetFacesSource:f,obstacleFree:at(A,c)}}var he=6,I=.001;function Qt(e,t,r,n,o){let a=new Set,l=c=>{let v=c;for(;v&&!a.has(v);)a.add(v),v=r.get(v)?.parentId};l(t.get(e.source.id)?.parentId??o.get(e.source.id)?.parentId),l(t.get(e.target.id)?.parentId??o.get(e.target.id)?.parentId);let s=(c,v,m)=>({id:c,kind:v,x:m.x-he,y:m.y-he,width:m.width+he*2,height:m.height+he*2}),d=[];for(let c of n)c.id===e.source.id||c.id===e.target.id||d.push(s(c.id,"service",c));for(let c of o.values())c.id===e.source.id||c.id===e.target.id||d.push(s(c.id,"junction",c));for(let c of r.values())a.has(c.id)||d.push(s(c.id,"group",c));return d}function st(e,t,r){switch(t){case"L":return r.x<e.x-I;case"R":return r.x>e.x+I;case"T":return r.y<e.y-I;case"B":return r.y>e.y+I}}function at(e,t){for(let r=1;r<e.length;r++)if(t.some(n=>ft(e[r-1],e[r],n)))return!1;return!0}function ft(e,t,r){return Math.abs(e.y-t.y)<=I?e.y>r.y+I&&e.y<r.y+r.height-I&&Math.min(e.x,t.x)<r.x+r.width-I&&Math.max(e.x,t.x)>r.x+I:Math.abs(e.x-t.x)<=I?e.x>r.x+I&&e.x<r.x+r.width-I&&Math.min(e.y,t.y)<r.y+r.height-I&&Math.max(e.y,t.y)>r.y+I:!0}var Me=class{entries=[];push(t){this.entries.push(t);let r=this.entries.length-1;for(;r>0;){let n=Math.floor((r-1)/2);if(!this.before(t,this.entries[n]))break;this.entries[r]=this.entries[n],r=n}this.entries[r]=t}pop(){let t=this.entries[0],r=this.entries.pop();if(!t||!r||this.entries.length===0)return t;let n=0;for(this.entries[0]=r;;){let o=n*2+1,a=o+1;if(o>=this.entries.length)break;let l=o;if(a<this.entries.length&&this.before(this.entries[a],this.entries[o])&&(l=a),!this.before(this.entries[l],this.entries[n]))break;let s=this.entries[n];this.entries[n]=this.entries[l],this.entries[l]=s,n=l}return t}before(t,r){return t.cost<r.cost||t.cost===r.cost&&t.state<r.state}};function qt(e,t,r){let n=[...new Set([e.x,t.x,...r.flatMap(g=>[g.x,g.x+g.width])])].sort((g,i)=>g-i),o=[...new Set([e.y,t.y,...r.flatMap(g=>[g.y,g.y+g.height])])].sort((g,i)=>g-i),a=[],l=new Map,s=(g,i)=>`${g}\0${i}`,d=(g,i)=>r.some(x=>g>x.x+I&&g<x.x+x.width-I&&i>x.y+I&&i<x.y+x.height-I);for(let g of o)for(let i of n)d(i,g)&&!(i===e.x&&g===e.y)&&!(i===t.x&&g===t.y)||(l.set(s(i,g),a.length),a.push({x:i,y:g}));let c=l.get(s(e.x,e.y)),v=l.get(s(t.x,t.y));if(c===void 0||v===void 0)return null;let m=a.map(()=>[]),A=(g,i)=>{for(let x=1;x<g.length;x++){let P=g[x-1],h=g[x],y=a[P],$=a[h];if(r.some(O=>ft(y,$,O)))continue;let T=Math.abs(y.x-$.x)+Math.abs(y.y-$.y);m[P].push({point:h,direction:i,length:T}),m[h].push({point:P,direction:i,length:T})}};for(let g of o){let i=a.map((x,P)=>({point:x,index:P})).filter(x=>x.point.y===g).sort((x,P)=>x.point.x-P.point.x).map(x=>x.index);A(i,1)}for(let g of n){let i=a.map((x,P)=>({point:x,index:P})).filter(x=>x.point.x===g).sort((x,P)=>x.point.y-P.point.y).map(x=>x.index);A(i,2)}let p=a.length*3,f=new Array(p).fill(1/0),u=new Array(p).fill(-1),w=c*3;f[w]=0;let b=new Me;b.push({state:w,cost:0});let S=-1;for(;;){let g=b.pop();if(!g)break;if(g.cost!==f[g.state])continue;let i=Math.floor(g.state/3),x=g.state%3;if(i===v){S=g.state;break}for(let P of m[i]){let h=P.point*3+P.direction,y=x!==0&&x!==P.direction?8:0,$=g.cost+P.length+y;$>=f[h]||(f[h]=$,u[h]=g.state,b.push({state:h,cost:$}))}}if(S<0)return null;let L=[];for(let g=S;g>=0&&(L.push(a[Math.floor(g/3)]),g!==w);g=u[g]);return ke(L.reverse())}function Zt(e,t,r){let n=r?.edgeFontSize??11,o=r?.edgeFontWeight??400,a=6,l=(m,A,p)=>{let f=te(m,r?.edgeTextTransform),u=fe(f,n,o)+a*2,w=n+a*2;return{x0:A-u/2,y0:p-w/2,x1:A+u/2,y1:p+w/2}},s=(m,A)=>Math.min(m.x1,A.x1)-Math.max(m.x0,A.x0)>.5&&Math.min(m.y1,A.y1)-Math.max(m.y0,A.y0)>.5,d=t.map(m=>({x0:m.x,y0:m.y,x1:m.x+m.width,y1:m.y+m.height})),c=e.filter(m=>m.label&&m.labelPosition&&m.points.length>=2),v=[];for(let m of c){let A=l(m.label,m.labelPosition.x,m.labelPosition.y),p=g=>v.some(i=>s(g,i))||d.some(i=>s(g,i));if(!p(A)){v.push(A);continue}let f=m.points,u=[],w=0;for(let g=1;g<f.length;g++){let i=Math.hypot(f[g].x-f[g-1].x,f[g].y-f[g-1].y);u.push(i),w+=i}let b=g=>{let i=g;for(let x=0;x<u.length;x++){if(i<=u[x]||x===u.length-1){let P=u[x]===0?0:Math.max(0,Math.min(1,i/u[x]));return{x:f[x].x+(f[x+1].x-f[x].x)*P,y:f[x].y+(f[x+1].y-f[x].y)*P}}i-=u[x]}return f[f.length-1]},S=[.5,.4,.6,.3,.7,.25,.75,.2,.8,.15,.85],L=A;for(let g of S){let i=b(w*g),x=l(m.label,i.x,i.y);if(!p(x)){m.labelPosition={x:i.x,y:i.y},L=x;break}}v.push(L)}}function dt(e,t,r,n,o){if(e.boundary==="group"){let d=t.get(e.id),c=r.get(e.id),v=o.get(d.parentId),m=rr(v,c,e.side);return{anchor:m,exit:$e(m,e.side,Se)}}let a=r.get(e.id);if(a){let d=er(a,e.side);return{anchor:d,exit:$e(d,e.side,Se)}}let l=n.get(e.id);if(!l)throw new Error(`Unknown architecture endpoint "${e.id}"`);let s=tr(l,e.side);return{anchor:s,exit:$e(s,e.side,Se*.75)}}function er(e,t){switch(t){case"L":return{x:e.x,y:e.y+e.height/2};case"R":return{x:e.x+e.width,y:e.y+e.height/2};case"T":return{x:e.x+e.width/2,y:e.y};case"B":return{x:e.x+e.width/2,y:e.y+e.height}}}function tr(e,t){let r=e.x+e.width/2,n=e.y+e.height/2,o=Math.min(e.width,e.height)/2;switch(t){case"L":return{x:r-o,y:n};case"R":return{x:r+o,y:n};case"T":return{x:r,y:n-o};case"B":return{x:r,y:n+o}}}function rr(e,t,r){let n=t.x+t.width/2,o=t.y+t.height/2;switch(r){case"L":return{x:e.x,y:le(o,e.y+N,e.y+e.height-N)};case"R":return{x:e.x+e.width,y:le(o,e.y+N,e.y+e.height-N)};case"T":return{x:le(n,e.x+N,e.x+e.width-N),y:e.y};case"B":return{x:le(n,e.x+N,e.x+e.width-N),y:e.y+e.height}}}function nr(e,t,r,n){if(e.x===t.x||e.y===t.y)return[];let o=ut(r),a=ut(n);if(o!==a)return o==="horizontal"?[{x:t.x,y:e.y}]:[{x:e.x,y:t.y}];if(o==="horizontal"){let s=(e.x+t.x)/2;return[{x:s,y:e.y},{x:s,y:t.y}]}let l=(e.y+t.y)/2;return[{x:e.x,y:l},{x:t.x,y:l}]}function ut(e){return e==="L"||e==="R"?"horizontal":"vertical"}function $e(e,t,r){switch(t){case"L":return{x:e.x-r,y:e.y};case"R":return{x:e.x+r,y:e.y};case"T":return{x:e.x,y:e.y-r};case"B":return{x:e.x,y:e.y+r}}}function ke(e){let t=[];for(let n of e){let o=t[t.length-1];o&&o.x===n.x&&o.y===n.y||t.push(n)}let r=!0;for(;r;){r=!1;for(let n=1;n<t.length-1;n++){let o=t[n-1],a=t[n],l=t[n+1],s=o.x===a.x&&a.x===l.x,d=o.y===a.y&&a.y===l.y;if(s||d){t.splice(n,1),r=!0;break}}}return t}function ir(e){if(e.length===0)return{x:0,y:0};if(e.length===1)return e[0];let t=0;for(let n=1;n<e.length;n++)t+=ht(e[n-1],e[n]);let r=t/2;for(let n=1;n<e.length;n++){let o=e[n-1],a=e[n],l=ht(o,a);if(r<=l){let s=l===0?0:r/l;return{x:o.x+(a.x-o.x)*s,y:o.y+(a.y-o.y)*s}}r-=l}return e[e.length-1]}function ht(e,t){return Math.abs(t.x-e.x)+Math.abs(t.y-e.y)}function le(e,t,r){return Math.max(t,Math.min(r,e))}function yt(e){let{positioned:t,colors:r,resolved:n}=e,o=n.renderOptions,a=r.font??"Inter",l=o.transparent??!1,s={...W,...n.familyAppearance?.visual??o.architecture?.visual},d=[],c=[s.groupSurface?`--arch-group-fill:${s.groupSurface}`:"",s.groupHeaderSurface?`--arch-group-band:${s.groupHeaderSurface}`:"",s.groupBorder?`--arch-group-stroke:${s.groupBorder}`:"",s.groupText?`--arch-group-label:${s.groupText}`:"",s.serviceSurface?`--arch-service-fill:${s.serviceSurface}`:"",s.serviceBorder?`--arch-service-stroke:${s.serviceBorder}`:"",s.serviceText?`--arch-service-label:${s.serviceText}`:"",s.edgeStroke?`--arch-edge-stroke:${s.edgeStroke}`:"",s.edgeText?`--arch-edge-label:${s.edgeText}`:""].filter(Boolean).join(";"),v=t.accessibilityTitle??t.title?.text,m=!!v,A=!!t.accessibilityDescription,p=`arch-${Ue(t.width,t.height,t.title?.text??"",t.services.map(i=>i.id).join(","),t.groups.map(i=>i.id).join(","))}`,f=`${p}-title`,u=`${p}-desc`,w={};(m||A)&&(w.role="img",w["aria-roledescription"]="architecture"),m&&(w["aria-labelledby"]=f),A&&(w["aria-describedby"]=u);let b=or(s),S=[];S.push(We(t.width,t.height,r,l,{style:c,attrs:w})),m&&S.push(`<title id="${f}">${me(v)}</title>`),A&&S.push(`<desc id="${u}">${me(t.accessibilityDescription)}</desc>`),S.push(Be(a,!1,void 0,r.embedFontImport)),S.push(b),d.push(He({id:"prelude",width:t.width,height:t.height,colors:r,transparent:l,font:a,hasMonoFont:!1,extraCss:b},S.join(`
8
+ `))),d.push(Ne({id:"defs",markerResources:pe},["<defs>",Ve(pe),"</defs>"].join(`
9
+ `))),t.title&&d.push(oe({id:"title",role:"title",text:t.title.text,x:t.title.x,y:t.title.y,fontSize:18,anchor:"middle",paint:{fill:"var(--arch-service-label, var(--_text))"}},ie(t.title.text,t.title.x,t.title.y,18,'class="architecture-title" text-anchor="middle" font-size="18" font-weight="600" fill="var(--arch-service-label, var(--_text))"')));for(let i of t.groups)d.push(bt(i,s));let L=new Map;for(let i of t.edges){let x=`${i.source.id}->${i.target.id}`,P=L.get(x)??0;L.set(x,P+1),d.push(ar(i,s,`edge:${x}#${P}`))}let g=new Map;for(let i of t.edges){if(!i.label)continue;let x=`${i.source.id}->${i.target.id}`,P=g.get(x)??0;g.set(x,P+1);for(let h of dr(i,s,`edge-label:${x}#${P}`))d.push(h)}for(let i of t.junctions)d.push(sr(i,s));for(let i of t.services)d.push(cr(i,s));return d.push(Xe()),{family:"architecture",width:t.width,height:t.height,colors:r,transparent:l,parts:d}}function or(e){return`<style>
10
+ .architecture-group-frame { fill: var(--arch-group-fill, color-mix(in srgb, var(--_node-fill) 82%, var(--bg))); stroke: none; }
11
+ .architecture-group-band { fill: var(--arch-group-band, color-mix(in srgb, var(--arch-edge-stroke, var(--_arrow)) 5%, var(--arch-group-fill, var(--bg)))); stroke: none; }
12
+ .architecture-group-outline { fill: none; stroke: var(--arch-group-stroke, var(--_node-stroke)); stroke-width: ${e.groupLineWidth}; }
13
+ .architecture-group-label { fill: var(--arch-group-label, var(--_text-sec)); }
14
+ .architecture-service-card { fill: var(--arch-service-fill, color-mix(in srgb, var(--_node-fill) 92%, var(--bg))); stroke: none; }
15
+ .architecture-service-outline { fill: none; stroke: var(--arch-service-stroke, var(--_node-stroke)); stroke-width: ${e.serviceLineWidth}; }
16
+ .architecture-service-label { fill: var(--arch-service-label, var(--_text)); }
17
+ .architecture-edge { fill: none; stroke: var(--arch-edge-stroke, var(--_line)); stroke-width: ${e.edgeLineWidth}; stroke-linejoin: round; }
18
+ .architecture-edge-label-bg { fill: color-mix(in srgb, var(--bg) 90%, var(--_group-hdr)); stroke: color-mix(in srgb, var(--arch-edge-stroke, var(--_line)) 18%, var(--bg)); stroke-width: 0.75; }
19
+ .architecture-edge-label-text { fill: var(--arch-edge-label, var(--_text-muted)); }
20
+ .architecture-junction-ring { fill: var(--bg); stroke: var(--arch-edge-stroke, var(--_arrow)); stroke-width: 1.25; }
21
+ .architecture-junction-core { fill: color-mix(in srgb, var(--arch-edge-stroke, var(--_arrow)) 24%, var(--bg)); stroke: var(--arch-edge-stroke, var(--_arrow)); stroke-width: 0.75; }
22
+ .architecture-icon-mark { fill: none; stroke: var(--arch-edge-stroke, var(--_arrow)); stroke-width: 1.25; stroke-linecap: round; stroke-linejoin: round; }
23
+ .architecture-icon-glyph { fill: var(--arch-edge-stroke, var(--_arrow)); }
24
+ </style>`}function bt(e,t){let r=[],n=`<g class="architecture-group" data-id="${H(e.id)}" data-label="${H(e.label)}">`;r.push({indent:2,node:U({id:`group-frame:${e.id}`,role:"group",geometry:{kind:"rect",x:e.x,y:e.y,width:e.width,height:e.height,rx:t.groupCornerRadius,ry:t.groupCornerRadius},paint:{fill:"var(--arch-group-fill, color-mix(in srgb, var(--_node-fill) 82%, var(--bg)))",stroke:"none"}},`<rect class="architecture-group-frame" x="${e.x}" y="${e.y}" width="${e.width}" height="${e.height}" rx="${t.groupCornerRadius}" ry="${t.groupCornerRadius}" />`)});let o=Oe(e.x,e.y,e.width,t.groupHeaderHeight,t.groupCornerRadius);r.push({indent:2,node:U({id:`group-band:${e.id}`,role:"group-header",geometry:{kind:"path",d:o},paint:{fill:"var(--arch-group-band, color-mix(in srgb, var(--arch-edge-stroke, var(--_arrow)) 5%, var(--arch-group-fill, var(--bg))))",stroke:"none"}},`<path class="architecture-group-band" d="${o}" />`)}),r.push({indent:2,node:U({id:`group-outline:${e.id}`,role:"group",geometry:{kind:"rect",x:e.x,y:e.y,width:e.width,height:e.height,rx:t.groupCornerRadius,ry:t.groupCornerRadius},paint:{fill:"none",stroke:"var(--arch-group-stroke, var(--_node-stroke))",strokeWidth:String(t.groupLineWidth)}},`<rect class="architecture-group-outline" x="${e.x}" y="${e.y}" width="${e.width}" height="${e.height}" rx="${t.groupCornerRadius}" ry="${t.groupCornerRadius}" />`)}),e.icon&&r.push({indent:0,node:ye({id:`icon:${e.id}`,role:"icon"},` ${vt(e.x+10,e.y+6,t.iconSize,e.icon,!0)}`)});let a=te(e.label,t.groupTextTransform),l=e.x+(e.icon?36:t.groupLabelPaddingX),s=e.y+t.groupHeaderHeight/2;r.push({indent:2,node:oe({id:`group-label:${e.id}`,role:"label",text:a,x:l,y:s,fontSize:t.groupFontSize,anchor:"start",paint:{fill:"var(--arch-group-label, var(--_text-sec))"}},ie(a,l,s,t.groupFontSize,`class="architecture-group-label" text-anchor="start" font-size="${t.groupFontSize}" font-weight="${t.groupFontWeight}"${t.groupFont?` font-family="${H(t.groupFont)}"`:""}${Re(t.groupLetterSpacing)}`))});for(let d of e.children)r.push({indent:0,node:bt(d,t)});return ce({id:`group:${e.id}`,role:"group",open:n,close:"</g>",children:r})}function cr(e,t){let r=[],n=!!e.icon,o=e.x+t.servicePaddingX,a=e.y+e.height/2-t.serviceIconSize/2,l=n?o+t.serviceIconSize+Math.max(10,t.servicePaddingX*.7):e.x+t.servicePaddingX,s=`<g class="architecture-service" data-id="${H(e.id)}" data-label="${H(e.label)}">`;r.push({indent:2,node:U({id:`service-card:${e.id}`,role:"service",geometry:{kind:"rect",x:e.x,y:e.y,width:e.width,height:e.height,rx:t.serviceCornerRadius,ry:t.serviceCornerRadius},paint:{fill:"var(--arch-service-fill, color-mix(in srgb, var(--_node-fill) 92%, var(--bg)))",stroke:"none"}},`<rect class="architecture-service-card" x="${e.x}" y="${e.y}" width="${e.width}" height="${e.height}" rx="${t.serviceCornerRadius}" ry="${t.serviceCornerRadius}" />`)}),r.push({indent:2,node:U({id:`service-outline:${e.id}`,role:"service",geometry:{kind:"rect",x:e.x,y:e.y,width:e.width,height:e.height,rx:t.serviceCornerRadius,ry:t.serviceCornerRadius},paint:{fill:"none",stroke:"var(--arch-service-stroke, var(--_node-stroke))",strokeWidth:String(t.serviceLineWidth)}},`<rect class="architecture-service-outline" x="${e.x}" y="${e.y}" width="${e.width}" height="${e.height}" rx="${t.serviceCornerRadius}" ry="${t.serviceCornerRadius}" />`)}),e.icon&&r.push({indent:0,node:ye({id:`icon:${e.id}`,role:"icon"},` ${vt(o,a,t.serviceIconSize,e.icon,!1)}`)});let d=e.y+e.height/2,c=te(e.label,t.serviceTextTransform);return r.push({indent:2,node:oe({id:`service-label:${e.id}`,role:"label",text:c,x:l,y:d,fontSize:t.serviceFontSize,anchor:"start",paint:{fill:"var(--arch-service-label, var(--_text))"}},ie(c,l,d,t.serviceFontSize,`class="architecture-service-label" text-anchor="start" font-size="${t.serviceFontSize}" font-weight="${t.serviceFontWeight}"${Re(t.serviceLetterSpacing)}`))}),ce({id:`service:${e.id}`,role:"service",open:s,close:"</g>",children:r})}function sr(e,t){let r=e.x+e.width/2,n=e.y+e.height/2,o=U({id:`junction-ring:${e.id}`,role:"junction",geometry:{kind:"circle",cx:r,cy:n,r:t.junctionOuterRadius},paint:{fill:"var(--bg)",stroke:"var(--arch-edge-stroke, var(--_arrow))",strokeWidth:"1.25"}},`<circle class="architecture-junction-ring" cx="${r}" cy="${n}" r="${t.junctionOuterRadius}" />`),a=U({id:`junction-core:${e.id}`,role:"junction",geometry:{kind:"circle",cx:r,cy:n,r:t.junctionInnerRadius},paint:{fill:"color-mix(in srgb, var(--arch-edge-stroke, var(--_arrow)) 24%, var(--bg))",stroke:"var(--arch-edge-stroke, var(--_arrow))",strokeWidth:"0.75"}},`<circle class="architecture-junction-core" cx="${r}" cy="${n}" r="${t.junctionInnerRadius}" />`);return ce({id:`junction:${e.id}`,role:"junction",open:`<g class="architecture-junction" data-id="${H(e.id)}">`,close:"</g>",children:[{indent:2,node:o},{indent:2,node:a}]})}function ar(e,t,r){let n=e.points.map(v=>`${v.x},${v.y}`).join(" "),o="",a,l;e.hasArrowStart&&(a=pe[1],o+=' marker-start="url(#architecture-arrow-start)"'),e.hasArrowEnd&&(l=pe[0],o+=' marker-end="url(#architecture-arrow-end)"');let s=['class="architecture-edge"',`data-from="${H(e.source.id)}"`,`data-to="${H(e.target.id)}"`,`data-from-side="${e.source.side}"`,`data-to-side="${e.target.side}"`,`data-from-boundary="${e.source.boundary}"`,`data-to-boundary="${e.target.boundary}"`];e.label&&s.push(`data-label="${H(e.label)}"`);let d={stroke:"var(--arch-edge-stroke, var(--_line))",strokeWidth:String(t.edgeLineWidth)},c={endpoints:{from:e.source.id,to:e.target.id},relationship:{kind:"architecture-edge"},route:{ownership:"layout",bendRadius:t.edgeBendRadius,labelAnchors:e.labelPosition?[e.labelPosition]:[]},labels:e.label?[{text:e.label,...e.labelPosition?{anchor:e.labelPosition}:{}}]:[]};if(t.edgeBendRadius>0&&e.points.length>2){let v=Ge(e.points,t.edgeBendRadius,{metric:"manhattan",precision:3});return xe({id:r,role:"edge",geometry:v.geometry,lineStyle:"solid",paint:d,markers:{...a?{start:a}:{},mid:[],...l?{end:l}:{}},...c,route:{...c.route,contours:v.contours}},`<path ${s.join(" ")} d="${v.geometry.d}"${o} />`)}return xe({id:r,role:"edge",geometry:{kind:"polyline",points:e.points},lineStyle:"solid",paint:d,markers:{...a?{start:a}:{},mid:[],...l?{end:l}:{}},...c},`<polyline ${s.join(" ")} points="${n}"${o} />`)}function dr(e,t,r){let n=te(e.label,t.edgeTextTransform),o=e.labelPosition??lr(e.points),a=Ie(n,t.edgeFontSize,t.edgeFontWeight),l=7,s=je(n,o.x,o.y,a.width,a.height,t.edgeFontSize,l,`class="architecture-edge-label-text" text-anchor="middle" font-size="${t.edgeFontSize}" font-weight="${t.edgeFontWeight}"${Re(t.edgeLetterSpacing)}`,'class="architecture-edge-label-bg" rx="0" ry="0"'),d=s.indexOf(`
25
+ `),c=s.slice(0,d),v=s.slice(d+1),m=a.width+l*2,A=a.height+l*2;return[U({id:`${r}:bg`,role:"chrome",geometry:{kind:"rect",x:o.x-m/2,y:o.y-A/2,width:m,height:A,rx:0,ry:0},paint:{fill:"color-mix(in srgb, var(--bg) 90%, var(--_group-hdr))",stroke:"color-mix(in srgb, var(--arch-edge-stroke, var(--_line)) 18%, var(--bg))",strokeWidth:"0.75"}},c),oe({id:r,role:"label",text:n,x:o.x,y:o.y,fontSize:t.edgeFontSize,anchor:"middle",paint:{fill:"var(--arch-edge-label, var(--_text-muted))"}},v)]}function vt(e,t,r,n,o){let a=[],l=n.trim().toLowerCase(),d=!l.includes(":")&&!l.includes("/")&&["cloud","database","disk","internet","server"].includes(l)?null:Ye(n),c=d?` data-icon-source="${d.source}" data-icon-license="${d.license}"`:"";return a.push(`<g class="architecture-icon" data-icon="${H(n)}"${c}>`),a.push(` ${ur(e,t,r,n,o,d)}`),a.push("</g>"),a.join(`
26
+ `)}function ur(e,t,r,n,o,a){let l=At(n),s=e+r/2,d=t+r/2,c=o?r*.92:r;if(a){let v=(r-c)/2,m=c/24;return`<path class="architecture-icon-glyph" d="${a.path}" transform="translate(${e+v} ${t+v}) scale(${m})" />`}switch(l){case"cloud":return[`<circle class="architecture-icon-mark" cx="${s-c*.18}" cy="${d+c*.02}" r="${c*.16}" />`,`<circle class="architecture-icon-mark" cx="${s+c*.02}" cy="${d-c*.08}" r="${c*.2}" />`,`<circle class="architecture-icon-mark" cx="${s+c*.2}" cy="${d+c*.02}" r="${c*.15}" />`,`<path class="architecture-icon-mark" d="M ${s-c*.34} ${d+c*.16} H ${s+c*.33}" />`].join(`
27
+ `);case"database":return[`<ellipse class="architecture-icon-mark" cx="${s}" cy="${d-c*.16}" rx="${c*.24}" ry="${c*.1}" />`,`<path class="architecture-icon-mark" d="M ${s-c*.24} ${d-c*.16} V ${d+c*.2}" />`,`<path class="architecture-icon-mark" d="M ${s+c*.24} ${d-c*.16} V ${d+c*.2}" />`,`<ellipse class="architecture-icon-mark" cx="${s}" cy="${d+c*.02}" rx="${c*.24}" ry="${c*.1}" />`,`<ellipse class="architecture-icon-mark" cx="${s}" cy="${d+c*.2}" rx="${c*.24}" ry="${c*.1}" />`].join(`
28
+ `);case"disk":return[`<circle class="architecture-icon-mark" cx="${s}" cy="${d}" r="${c*.26}" />`,`<circle class="architecture-icon-mark" cx="${s}" cy="${d}" r="${c*.09}" />`].join(`
29
+ `);case"internet":return[`<circle class="architecture-icon-mark" cx="${s}" cy="${d}" r="${c*.26}" />`,`<path class="architecture-icon-mark" d="M ${s-c*.26} ${d} H ${s+c*.26}" />`,`<path class="architecture-icon-mark" d="M ${s} ${d-c*.26} V ${d+c*.26}" />`,`<path class="architecture-icon-mark" d="M ${s-c*.14} ${d-c*.22} Q ${s} ${d} ${s-c*.14} ${d+c*.22}" />`,`<path class="architecture-icon-mark" d="M ${s+c*.14} ${d-c*.22} Q ${s} ${d} ${s+c*.14} ${d+c*.22}" />`].join(`
30
+ `);case"server":return[`<rect class="architecture-icon-mark" x="${s-c*.22}" y="${d-c*.24}" width="${c*.44}" height="${c*.48}" rx="0" ry="0" />`,`<path class="architecture-icon-mark" d="M ${s-c*.16} ${d-c*.08} H ${s+c*.16}" />`,`<path class="architecture-icon-mark" d="M ${s-c*.16} ${d+c*.06} H ${s+c*.16}" />`].join(`
31
+ `);default:{let v=hr(n);return ie(v,s,d,Math.max(10,r*.56),`class="architecture-icon-glyph architecture-icon-fallback" data-fallback="true" text-anchor="middle" font-size="${Math.max(10,r*.56)}" font-weight="700"`)}}}function At(e){return e.trim().toLowerCase().split(/[:/]/).pop()??e.trim().toLowerCase()}function hr(e){return(At(e).replace(/[^a-z0-9]/g,"")[0]??"?").toUpperCase()}var mt={fill:"var(--arch-edge-stroke, var(--_arrow))",stroke:"var(--arch-edge-stroke, var(--_arrow))",strokeWidth:"0.75",strokeLinejoin:"round"},pe=[{id:"architecture-arrow-end",shape:"arrow",size:{width:8,height:5},ref:{x:7,y:2.5},orient:"auto",geometry:{kind:"polygon",points:[{x:0,y:0},{x:8,y:2.5},{x:0,y:5}]},paint:mt},{id:"architecture-arrow-start",shape:"arrow",size:{width:8,height:5},ref:{x:1,y:2.5},orient:"auto-start-reverse",geometry:{kind:"polygon",points:[{x:8,y:0},{x:0,y:2.5},{x:8,y:5}]},paint:mt}];function lr(e){if(e.length===0)return{x:0,y:0};if(e.length===1)return e[0];let t=0;for(let n=1;n<e.length;n++)t+=xt(e[n-1],e[n]);let r=t/2;for(let n=1;n<e.length;n++){let o=e[n-1],a=e[n],l=xt(o,a);if(r<=l){let s=l===0?0:r/l;return{x:o.x+(a.x-o.x)*s,y:o.y+(a.y-o.y)*s}}r-=l}return e[e.length-1]}function xt(e,t){return Math.abs(t.x-e.x)+Math.abs(t.y-e.y)}function Re(e){return e!==0?` letter-spacing="${e}"`:""}var Qr=Fe(Je,{normalizeRequest:e=>{let t=Qe(e.source.frontmatter,e.colors,e.renderOptions,e.styleFace);return{renderOptions:{...e.renderOptions,padding:e.renderOptions.padding??t.padding,nodeSpacing:e.renderOptions.nodeSpacing??t.nodeSpacing,layerSpacing:e.renderOptions.layerSpacing??t.layerSpacing},familyConfig:{layout:t.layout},appearance:{family:{visual:t.visual}}}},layout:e=>{let t=e.familyConfig,r=Ce(nt(e.source.familyLines),e.source.accessibility);return _e(lt(r,e.renderOptions,t?.layout),{injectAccessibility:!1})},lowerScene:Le(yt)});export{Qr as default};
@@ -0,0 +1,4 @@
1
+ import{a as V}from"./chunk-T7IJ6V4B.js";import{a as R}from"./chunk-WEUWIFG3.js";import{a as q}from"./chunk-KJVNXJ5Y.js";import{L as T}from"./chunk-FXBBGAMJ.js";var U={rect:{aliases:["proc","process","rectangle"],geometry:"rectangle",exact:!0,description:"Process"},rounded:{aliases:["event"],geometry:"rounded",exact:!0,description:"Event"},stadium:{aliases:["pill","terminal"],geometry:"stadium",exact:!0,description:"Terminal point"},cyl:{aliases:["cylinder","database","db"],geometry:"cylinder",exact:!0,description:"Database"},diam:{aliases:["decision","diamond","question"],geometry:"diamond",exact:!0,description:"Decision"},hex:{aliases:["hexagon","prepare"],geometry:"hexagon",exact:!0,description:"Prepare conditional"},"lean-r":{aliases:["in-out","lean-right"],geometry:"lean-r",exact:!0,description:"Data input/output"},"lean-l":{aliases:["lean-left","out-in"],geometry:"lean-l",exact:!0,description:"Data output/input"},"trap-b":{aliases:["priority","trapezoid","trapezoid-bottom"],geometry:"trapezoid",exact:!0,description:"Priority action"},"trap-t":{aliases:["inv-trapezoid","manual","trapezoid-top"],geometry:"trapezoid-alt",exact:!0,description:"Manual operation"},circle:{aliases:["circ"],geometry:"circle",exact:!0,description:"Start"},"dbl-circ":{aliases:["double-circle"],geometry:"doublecircle",exact:!0,description:"Stop"},"fr-rect":{aliases:["framed-rectangle","subproc","subprocess","subroutine"],geometry:"subroutine",exact:!0,description:"Subprocess"},odd:{aliases:[],geometry:"asymmetric",exact:!0,description:"Odd"},bang:{aliases:[],geometry:"circle",exact:!0,description:"Bang"},"notch-rect":{aliases:["card","notched-rectangle"],geometry:"rectangle",exact:!0,description:"Card"},cloud:{aliases:[],geometry:"rounded",exact:!0,description:"Cloud"},hourglass:{aliases:["collate"],geometry:"diamond",exact:!0,description:"Collate"},bolt:{aliases:["com-link","lightning-bolt"],geometry:"rectangle",exact:!0,description:"Com link"},brace:{aliases:["brace-l","comment"],geometry:"rectangle",exact:!0,description:"Comment"},"brace-r":{aliases:[],geometry:"rectangle",exact:!0,description:"Comment right"},braces:{aliases:[],geometry:"rectangle",exact:!0,description:"Comment both"},datastore:{aliases:["data-store"],geometry:"cylinder",exact:!0,description:"Data store"},delay:{aliases:["half-rounded-rectangle"],geometry:"rounded",exact:!0,description:"Delay"},"h-cyl":{aliases:["das","horizontal-cylinder"],geometry:"cylinder",exact:!0,description:"Direct access storage"},"lin-cyl":{aliases:["disk","lined-cylinder"],geometry:"cylinder",exact:!0,description:"Disk storage"},"curv-trap":{aliases:["curved-trapezoid","display"],geometry:"rounded",exact:!0,description:"Display"},"div-rect":{aliases:["div-proc","divided-process","divided-rectangle"],geometry:"rectangle",exact:!0,description:"Divided process"},doc:{aliases:["document"],geometry:"rectangle",exact:!0,description:"Document"},tri:{aliases:["extract","triangle"],geometry:"trapezoid",exact:!0,description:"Extract"},fork:{aliases:["join"],geometry:"rectangle",exact:!0,description:"Fork/join"},"win-pane":{aliases:["internal-storage","window-pane"],geometry:"rectangle",exact:!0,description:"Internal storage"},"f-circ":{aliases:["filled-circle","junction"],geometry:"circle",exact:!0,description:"Junction"},"lin-doc":{aliases:["lined-document"],geometry:"rectangle",exact:!0,description:"Lined document"},"lin-rect":{aliases:["lin-proc","lined-process","lined-rectangle","shaded-process"],geometry:"subroutine",exact:!0,description:"Lined/shaded process"},"notch-pent":{aliases:["loop-limit","notched-pentagon"],geometry:"hexagon",exact:!0,description:"Loop limit"},"flip-tri":{aliases:["flipped-triangle","manual-file"],geometry:"trapezoid-alt",exact:!0,description:"Manual file"},"sl-rect":{aliases:["manual-input","sloped-rectangle"],geometry:"lean-r",exact:!0,description:"Manual input"},docs:{aliases:["documents","st-doc","stacked-document"],geometry:"rectangle",exact:!0,description:"Multi-document"},"st-rect":{aliases:["processes","procs","stacked-rectangle"],geometry:"rectangle",exact:!0,description:"Multi-process"},flag:{aliases:["paper-tape"],geometry:"rectangle",exact:!0,description:"Paper tape"},"sm-circ":{aliases:["small-circle","start"],geometry:"circle",exact:!0,description:"Start (small)"},"fr-circ":{aliases:["framed-circle","stop"],geometry:"doublecircle",exact:!0,description:"Stop (framed)"},"bow-rect":{aliases:["bow-tie-rectangle","stored-data"],geometry:"cylinder",exact:!0,description:"Stored data"},"cross-circ":{aliases:["crossed-circle","summary"],geometry:"circle",exact:!0,description:"Summary"},"tag-doc":{aliases:["tagged-document"],geometry:"rectangle",exact:!0,description:"Tagged document"},"tag-rect":{aliases:["tag-proc","tagged-process","tagged-rectangle"],geometry:"rectangle",exact:!0,description:"Tagged process"},text:{aliases:[],geometry:"rectangle",exact:!0,description:"Text block"}},Se=(()=>{let t=new Map;for(let[e,n]of Object.entries(U)){t.set(e,e);for(let r of n.aliases)t.set(r,e)}return t})();function X(t){let e=Se.get(t.trim().toLowerCase());if(!e)return null;let n=U[e];return{canonical:e,geometry:n.geometry,exact:n.exact,description:n.description}}var we=/^note\s+(left|right)\s+of\s+([\w\p{L}-]+)\s*:\s*(.+)$/iu,xe=/^note\s+(left|right)\s+of\s+([\w\p{L}-]+)\s*$/iu,Me=/^end\s+note$/i,Ee=/^state\s+(?:"([^"]+)"\s+as\s+)?([\w\p{L}-]+)\s*<<\s*(fork|join|choice|history|deephistory|H\*|H)\s*>>$/u,Ne=/^-{2,}$/,Le=/^([\w\p{L}-]*)\[(H\*?)\]$/u,Re=/^[\w\p{L}-]+$/u;function Y(t){return Re.test(t)}function J(t){let e=t.match(we);return e?{side:e[1].toLowerCase(),target:e[2],text:e[3].trim()}:null}function K(t){let e=t.match(xe);return e?{side:e[1].toLowerCase(),target:e[2]}:null}function Z(t){return Me.test(t)}function ee(t){let e=t.match(Ee);if(!e)return null;let n=e[3],r=n==="H"||n==="history"?"history":n==="H*"||n==="deephistory"?"deep-history":n;return{id:e[2],stereotype:r,...e[1]!==void 0?{label:e[1]}:{}}}function te(t){return Ne.test(t)}function ne(t){let e=t.match(Le);return e?{base:e[1],deep:e[2]==="H*"}:null}function W(t){return t?"H*":"H"}var Q=String.raw`\[\*\]|[\w\p{L}-]+\[H\*?\]|\[H\*?\]|[\w\p{L}-]+`,ke=new RegExp(`^(${Q})(?::::([\\w-]+))?\\s*-->\\s*(${Q})(?::::([\\w-]+))?(?:\\s*:\\s*(.+))?$`,"u");function re(t){let e=t.match(ke);if(!e)return null;let n=e[5]?.trim();return{from:e[1],...e[2]?{fromClass:e[2]}:{},to:e[3],...e[4]?{toClass:e[4]}:{},...n?{label:n}:{}}}var D=String.raw`[\p{L}\p{N}_-]+`,ft=new RegExp(`^${D}$`,"u"),Ie=new RegExp(`^(${D})`,"u"),Te=/^[\w-]+/;function F(t){let e=t.match(Ie);return e?{id:e[1],length:e[1].length}:null}function P(t){if(!t.startsWith(":::"))return null;let e=t.slice(3).match(Te);return e?{className:e[0],length:3+e[0].length}:null}function se(t){let e=F(t);if(!e)return null;let n=P(t.slice(e.length));return!n||e.length+n.length!==t.length?null:{id:e.id,className:n.className}}function Ae(t){let e=Array(t.length).fill(" "),n=0,r,s=!1,o=!1;for(let i=0;i<t.length;i++){let a=t[i];if(r){o?o=!1:a==="\\"?o=!0:a===r&&(r=void 0);continue}if(a==='"'||a==="'"||a==="`"){r=a;continue}if(a==="|"&&n===0){s=!s;continue}if(!s){if(a==="["||a==="("||a==="{"){n++;continue}if(a==="]"||a===")"||a==="}"){n=Math.max(0,n-1);continue}n===0&&(e[i]=a)}}return e.join("")}function $e(t,e){if(e<=0||t[e-1]!=="@")return!1;let n=e-2;for(;n>=0&&/[\p{L}\p{N}_-]/u.test(t[n]);)n--;return n<e-2&&(n<0||/\s/.test(t[n]))}function Ce(t,e){if(e>0&&!/\s/.test(t[e-1])&&!$e(t,e))return-1;let n=e;if(t[n]==="<"&&n++,t[n]==="-")if(t[n+1]==="-")for(n+=2;t[n]==="-";)n++;else if(t[n+1]===".")for(n+=2;t[n]===".";)n++;else return-1;else if(t[n]==="="&&t[n+1]==="=")for(n+=2;t[n]==="=";)n++;else return-1;return/\s/.test(t[n]??"")?n:-1}function De(t,e){if(e>0&&!/\s/.test(t[e-1]))return-1;if(t[e]==="."){let n=e;for(;t[n]===".";)n++;return t[n]==="-"&&t[n+1]===">"?n+2:-1}if(t[e]==="-"){if(t[e+1]==="."){let s=e+1;for(;t[s]===".";)s++;return t[s]!=="-"?-1:t[s+1]===">"?s+2:s+1}let n=e;for(;t[n]==="-";)n++;let r=n-e;return r<2?-1:t[n]===">"||t[n]==="o"||t[n]==="x"?n+1:r>=3?n:-1}if(t[e]==="="){let n=e;for(;t[n]==="=";)n++;let r=n-e;return r<2?-1:t[n]===">"?n+1:r>=3?n:-1}return-1}function ie(t){let e=Ae(t),n=[],r=-1;for(let s=0;s<e.length;s++){if(r<0){let u=Ce(e,s);u>=0&&(r=u,s=u-1);continue}let o=De(e,s);if(o<0)continue;let i=t.slice(r,s),a=i.length-i.trimStart().length,l=i.trim();if(l){let u=r+a;n.push({start:u,end:u+l.length})}r=-1,s=o-1}return n}function Nt(t){let e=_e(Oe(Fe(t.split(`
2
+ `))).map(i=>i.trim()).filter(i=>i.length>0&&!i.startsWith("%%")));if(e.length===0)throw new Error("Empty mermaid diagram");let n=e[0],r=V(n,"strict"),s=r.kind==="registered"?r.familyId:q(n);if(s==="state")return qe(e);if(s==="flowchart")return He(e);if(r.kind==="unknown")throw new Error(`Unknown Mermaid diagram header: ${n}`);let o=r.kind==="registered"?r.familyId:r.match.family.id;throw new Error(`Mermaid family "${o}" is not a graph family; use the family-neutral agent parser`)}function _e(t){return t.length===0||!t[0].includes(";")||!/^(?:graph|flowchart|swimlane|stateDiagram(?:-v2)?)(?:\b|\s)/i.test(t[0])?t:[...H(t[0]),...t.slice(1)]}function Oe(t){let e=[],n=null,r=0;for(let s of t){if(n){n.push(s.trim()),r+=oe(s),r<=0&&(e.push(n.join(" ")),n=null,r=0);continue}if(/@\s*\{/.test(s)){r=oe(s),r>0?n=[s.trim()]:e.push(s);continue}e.push(s)}return n&&e.push(n.join(" ")),e}function oe(t){let e=0,n=null,r=!1;for(let s of t){if(r){r=!1;continue}if(s==="\\"){r=!0;continue}if(n){s===n&&(n=null);continue}if(s==='"'||s==="'"){n=s;continue}s==="{"?e++:s==="}"&&e--}return e}function Fe(t){let e=[],n=null;for(let r of t){if(n){n.push(r.trim()),ae(r)%2===1&&(e.push(n.join("<br>")),n=null);continue}if(r.trim().startsWith("%%")){e.push(r);continue}if(ae(r)%2===1){n=[r];continue}e.push(r)}return n&&e.push(n.join("<br>")),e}function ae(t){let e=0,n=!1;for(let r of t){if(n){n=!1;continue}if(r==="\\"){n=!0;continue}r==="`"&&e++}return e}function ve(t){return T(t)}function $(t,e=!1){let n=!e&&t.length>=2&&t.startsWith('"')&&t.endsWith('"')?t.slice(1,-1):t;return(e||n!==t)&&n.length>=2&&n.startsWith("`")&&n.endsWith("`")?{text:ve(n.slice(1,-1)),markdown:!0}:{text:T(t),markdown:!1}}function H(t){let e=[],n=ie(t),r=0,s=0,o=0,i=null,a=!1,l=!1;for(let d=0;d<t.length;d++){let c=t[d];if(a){a=!1;continue}if(c==="\\"){a=!0;continue}if(i){c===i&&(i=null);continue}if(c==='"'||c==="'"||c==="`"){i=c;continue}if(c==="|"&&o===0){l=!l;continue}if(!l){if(c==="["||c==="("||c==="{")o++;else if(c==="]"||c===")"||c==="}")o=Math.max(0,o-1);else if(c===";"&&o===0){for(;n[r]&&n[r].end<=d;)r++;let f=n[r];if(!f||d<f.start||d>=f.end){let y=t.slice(s,d).trim();y&&e.push(y),s=d+1}}}}let u=t.slice(s).trim();return u&&e.push(u),e}function Ge(t){return/^(?:click|href)\s+/i.test(t.trim())}function We(t,e){let n=e.trim().match(/^(?:click\s+)?([\w-]+)\s+(?:href\s+)?(?:"((?:\\.|[^"])*)"|(https?:\/\/\S+|mailto:\S+))/i);if(!n)return;let r=(n[2]??n[3]??"").replace(/\\(["\\])/g,"$1");if(!/^(?:https?:|mailto:)/i.test(r))return;let s=t.nodes.get(n[1]);s&&(s.href=r)}function C(t){if(t===void 0)return;let e=t.trim();return(e.length>=2&&(e.startsWith('"')&&e.endsWith('"')||e.startsWith("'")&&e.endsWith("'"))?e.slice(1,-1).replace(/\\(["'\\])/g,"$1"):e)||void 0}function Pe(t,e){let n=e.trim().match(/^([\w-]+)@\s*\{([\s\S]*)\}\s*$/);if(!n)return;let r=t.edges.find(l=>l.id===n[1]);if(!r)return;let s=B(n[2]),o=C(s.get("curve"));o&&/^[a-z][a-z0-9-]*$/i.test(o)&&(r.curve=o);let i=C(s.get("animate"))?.toLowerCase(),a=C(s.get("animation"))?.toLowerCase();if(i==="true"||i==="fast"||i==="slow"||a==="fast"||a==="slow"){r.animate=!0;let l=i==="fast"||i==="slow"?i:a;(l==="fast"||l==="slow")&&(r.animation=l)}}function je(t,e){let n=e.trim().match(/^([\w-]+)@\s*\{([\s\S]*)\}\s*$/);if(!n)return!1;if(t.edges.some(s=>s.id===n[1]))return!0;let r=B(n[2]);return!r.has("shape")&&!r.has("label")&&!r.has("icon")&&!r.has("img")}function He(t){let e=t[0].match(/^(?:(?:graph|swimlane)\s+(TD|TB|LR|BT|RL|[<>^v])|flowchart(?:\s+(TD|TB|LR|BT|RL|[<>^v]))?)\s*$/i);if(!e)throw new Error(`Invalid mermaid header: "${t[0]}". Expected "graph TD", "flowchart LR", "stateDiagram-v2", etc.`);let r={direction:Be(e[1]??e[2]??"TD"),nodes:new Map,edges:[],subgraphs:[],classDefs:new Map,classAssignments:new Map,nodeStyles:new Map,linkStyles:new Map},s=[],o=ze(t.slice(1));for(let i=1;i<t.length;i++)for(let a of H(t[i])){if(Ge(a)){We(r,a);continue}if(je(r,a)){Pe(r,a);continue}let l=a.match(/^classDef\s+([\w,-]+)\s+(.+)$/);if(l){let p=l[1].split(",").map(m=>m.trim()).filter(Boolean),S=R(l[2]);if(Object.keys(S).length===0)continue;for(let m of p)r.classDefs.set(m,S);continue}let u=a.match(/^class\s+([\w,-]+)\s+([\w-]+)\s*;?$/);if(u){let p=u[1].split(",").map(m=>m.trim()),S=u[2];for(let m of p)r.classAssignments.set(m,S);continue}let d=a.match(/^style\s+([\w,-]+)\s+(.+)$/);if(d){let p=d[1].split(",").map(m=>m.trim()),S=R(d[2]);if(Object.keys(S).length===0)continue;for(let m of p)r.nodeStyles.set(m,{...r.nodeStyles.get(m),...S});continue}let c=a.match(/^linkStyle\s+(default|[\d,\s]+)\s+(.+)$/);if(c){let p=c[1].trim(),S=R(c[2]);if(Object.keys(S).length===0)continue;if(p==="default")r.linkStyles.set("default",{...r.linkStyles.get("default"),...S});else{let m=p.split(",").map(h=>parseInt(h.trim(),10));for(let h of m)isNaN(h)||r.linkStyles.set(h,{...r.linkStyles.get(h),...S})}continue}let f=a.match(/^direction\s+(TD|TB|LR|BT|RL)\s*$/i);if(f){let p=f[1].toUpperCase();s.length>0?s[s.length-1].direction=p:r.direction=p;continue}let y=a.match(/^subgraph\s+(.+)$/);if(y){let p=y[1].trim(),S=p.match(/^([\w-]+)\s*\[(.+)\]$/),m,h;S?(m=S[1],h=$(S[2]).text):(h=$(p).text,m=p.replace(/\s+/g,"_").replace(/[^\w]/g,""));let M={id:m,label:h,nodeIds:[],children:[]};s.push(M);continue}if(a==="end"){let p=s.pop();p&&(s.length>0?s[s.length-1].children.push(p):r.subgraphs.push(p));continue}let w=nt(a,r,s,o);if(!w.ok)throw new Error(`Invalid flowchart statement "${a}": could not fully consume ${w.reason}; remaining input: "${w.remaining}"`)}return r}function ze(t){let e=new Set;for(let n of t)for(let r of H(n)){let s=r.match(/^subgraph\s+(.+)$/);if(!s)continue;let o=s[1].trim(),i=o.match(/^([\w-]+)\s*\[(.+)\]$/);e.add(i?i[1]:o.replace(/\s+/g,"_").replace(/[^\w]/g,""))}return e}function Be(t){let e=t.toUpperCase();return e===">"?"LR":e==="<"?"RL":e==="^"?"BT":e==="V"?"TB":e}function qe(t){let e={direction:"TD",nodes:new Map,edges:[],subgraphs:[],classDefs:new Map,classAssignments:new Map,nodeStyles:new Map,linkStyles:new Map},n=[],r=new Set,s=0,o=0,i=new Map,a=null,l=(d,c,f)=>{e.stateNotes||(e.stateNotes=[]),e.stateNotes.push({id:`note#${e.stateNotes.length}`,target:d,side:c,text:f}),r.has(d)||_(e,n,d)},u=(d,c)=>{if(d==="[*]"){if(c==="source"){s++;let w=`_start${s>1?s:""}`;return A(e,n,{id:w,label:"",shape:"state-start"}),w}o++;let y=`_end${o>1?o:""}`;return A(e,n,{id:y,label:"",shape:"state-end"}),y}let f=ne(d);if(f){let y=[...n].reverse().find(S=>!S.concurrencyRegion),p=`${f.base!==""?f.base:y?.id??""}[H${f.deep?"*":""}]`;return A(e,n,{id:p,label:W(f.deep),shape:"state-history"}),p}return r.has(d)||_(e,n,d),d};for(let d=1;d<t.length;d++){let c=t[d];if(a){Z(c)?(l(a.target,a.side,a.lines.join(`
3
+ `)),a=null):a.lines.push(c);continue}let f=J(c);if(f){l(f.target,f.side,T(f.text));continue}let y=K(c);if(y){a={target:y.target,side:y.side,lines:[]};continue}let w=c.match(/^direction\s+(TD|TB|LR|BT|RL)\s*$/i);if(w){n.length>0?n[n.length-1].direction=w[1].toUpperCase():e.direction=w[1].toUpperCase();continue}let p=c.match(/^classDef\s+([\w,-]+)\s+(.+)$/);if(p){let b=p[1].split(",").map(x=>x.trim()).filter(Boolean),g=R(p[2]);for(let x of b)e.classDefs.set(x,g);continue}let S=c.match(/^(?:class|cssClass)\s+([\w\p{L},-]+)\s+([\w-]+)$/u);if(S){let b=S[1].split(",").map(g=>g.trim()).filter(Boolean);for(let g of b)_(e,n,g),e.classAssignments.set(g,S[2]);continue}let m=c.match(/^style\s+([\w\p{L},-]+)\s+(.+)$/u);if(m){let b=m[1].split(",").map(x=>x.trim()).filter(Boolean),g=R(m[2]);for(let x of b)_(e,n,x),e.nodeStyles.set(x,{...e.nodeStyles.get(x),...g});continue}let h=c.match(/^linkStyle\s+(default|[\d,\s]+)\s+(.+)$/);if(h){let b=h[1].trim(),g=R(h[2]);if(Object.keys(g).length===0)continue;if(b==="default")e.linkStyles.set("default",{...e.linkStyles.get("default"),...g});else{let x=b.split(",").map(I=>parseInt(I.trim(),10));for(let I of x)isNaN(I)||e.linkStyles.set(I,{...e.linkStyles.get(I),...g})}continue}let M=ee(c);if(M){let b=M.stereotype==="fork"?"state-fork":M.stereotype==="join"?"state-join":M.stereotype==="choice"?"state-choice":"state-history",g=b==="state-history"?W(M.stereotype==="deep-history"):"";e.nodes.set(M.id,{id:M.id,label:g,shape:b}),Ve(n,M.id);continue}if(te(c)&&n.length>0){let b=n[n.length-1],g;if(b.concurrencyRegion)n.pop(),g=n[n.length-1];else{g=b;let I={id:`${g.id}__r${ce(i,g.id)}`,label:"",nodeIds:g.nodeIds.splice(0),children:g.children.splice(0),concurrencyRegion:!0};g.children.push(I)}let x={id:`${g.id}__r${ce(i,g.id)}`,label:"",nodeIds:[],children:[],concurrencyRegion:!0};g.children.push(x),n.push(x);continue}let L=c.match(/^state\s+(?:"([^"]+)"\s+as\s+)?([\w\p{L}-]+)\s*\{$/u);if(L){let b=L[1]??L[2],g=L[2],x={id:g,label:b,nodeIds:[],children:[]};n.push(x),r.add(g),e.nodes.delete(g);continue}if(c==="}"){n.length>0&&n[n.length-1].concurrencyRegion&&n.pop();let b=n.pop();b&&(n.length>0?n[n.length-1].children.push(b):e.subgraphs.push(b));continue}let k=c.match(/^state\s+"([^"]+)"\s+as\s+([\w\p{L}-]+)\s*$/u);if(k){let b=T(k[1]),g=k[2];A(e,n,{id:g,label:b,shape:"rounded"});continue}let N=re(c);if(N){let b=u(N.from,"source"),g=u(N.to,"target");N.fromClass&&e.classAssignments.set(b,N.fromClass),N.toClass&&e.classAssignments.set(g,N.toClass);let x=N.label?T(N.label):void 0;e.edges.push({source:b,target:g,label:x,style:"solid",hasArrowStart:!1,hasArrowEnd:!0});continue}let O=se(c);if(O){_(e,n,O.id),e.classAssignments.set(O.id,O.className);continue}let G=c.match(/^([\w\p{L}-]+)\s*:\s*(.+)$/u);if(G){let b=G[1],g=T(G[2].trim());A(e,n,{id:b,label:g,shape:"rounded"});continue}if(Y(c)){A(e,n,{id:c,label:c,shape:"rounded"});continue}}return a&&l(a.target,a.side,a.lines.join(`
4
+ `)),e}function ce(t,e){let n=(t.get(e)??0)+1;return t.set(e,n),n}function Ve(t,e){if(t.length>0){let n=t[t.length-1];n.nodeIds.includes(e)||n.nodeIds.push(e)}}function A(t,e,n){if(!t.nodes.has(n.id)&&t.nodes.set(n.id,n),e.length>0){let s=e[e.length-1];s.nodeIds.includes(n.id)||s.nodeIds.push(n.id)}}function _(t,e,n){if(!t.nodes.has(n))A(t,e,{id:n,label:n,shape:"rounded"});else if(e.length>0){let r=e[e.length-1];r.nodeIds.includes(n)||r.nodeIds.push(n)}}var fe=/^(<)?(~{3,}|-\.+->|-\.+-|={2,}>|={3,}|o-{2,}o|o-{2,}x|x-{2,}o|x-{2,}x|-{2,}[ox]|-{2,}>|-{3,})/;function Ue(t){let e=t.slice(1).search(/\S/)+1;if(e<1||t[e]!=='"')return-1;let n=!1;for(let r=e+1;r<t.length;r++){let s=t[r];if(n){n=!1;continue}if(s==="\\"){n=!0;continue}if(s==='"'&&/^\s*\|/.test(t.slice(r+1)))return r}return-1}function Xe(t){if(!t.startsWith("|"))return null;let e=Ue(t);for(let n=1;n<t.length;n++)if(!(e>=0&&n<e&&t[n]==="|")&&t[n]==="|")return{rawLabel:t.slice(1,n),consumed:n+1};return null}var Qe=/^(<)?(-{2,}|-\.+|={2,})/,Ye=/^(-{2,}[>ox]|-{3,}|\.+->|-\.+-|={2,}>|={3,})/;function Je(t,e){let n=t.slice(e).search(/\S/),r=n<0?-1:e+n;if(r<e||t[r]!=='"')return-1;let s=!1;for(let o=r+1;o<t.length;o++){let i=t[o];if(s){s=!1;continue}if(i==="\\"){s=!0;continue}if(i==='"'&&/^\s*(?:-{2,}[>ox]|-{3,}|\.+->|-\.+-|={2,}>|={3,})/.test(t.slice(o+1)))return o}return-1}function pe(t){let e=t.match(Qe);if(!e)return null;let n=Je(t,e[0].length);for(let r=e[0].length;r<t.length;r++){if(n>=0&&r<n)continue;let s=t.slice(r).match(Ye);if(!s)continue;let o=t.slice(e[0].length,r).trim();if(o.length!==0)return{hasArrowStart:!!e[1],openOp:e[2],rawLabel:o,closeOp:s[1],consumed:r+s[0].length}}return null}var E=t=>new RegExp(`^(${D})${t}`,"u"),Ke=[{regex:E(String.raw`\(\(\((.+?)\)\)\)`),shape:"doublecircle"},{regex:E(String.raw`\(\[(.+?)\]\)`),shape:"stadium"},{regex:E(String.raw`\(\((.+?)\)\)`),shape:"circle"},{regex:E(String.raw`\[\[(.+?)\]\]`),shape:"subroutine"},{regex:E(String.raw`\[\((.+?)\)\]`),shape:"cylinder"},{regex:E(String.raw`\[\/([^\]]+?)\\\]`),shape:"trapezoid"},{regex:E(String.raw`\[\\([^\]]+?)\/\]`),shape:"trapezoid-alt"},{regex:E(String.raw`\[\/([^\]]+?)\/\]`),shape:"lean-r"},{regex:E(String.raw`\[\\([^\]]+?)\\\]`),shape:"lean-l"},{regex:E(String.raw`>(.+?)\]`),shape:"asymmetric"},{regex:E(String.raw`\{\{(.+?)\}\}`),shape:"hexagon"},{regex:E(String.raw`\[(.+?)\]`),shape:"rectangle"},{regex:E(String.raw`\((.+?)\)`),shape:"rounded"},{regex:E(String.raw`\{(.+?)\}`),shape:"diamond"}];function Ze(t){let e=F(t);if(!e)return null;let n=e.length,r=0;for(let s=0;s<n&&!(s>0&&z(t.slice(s)));s++)r=s+1;return r>0?{id:t.slice(0,r),length:r}:null}function z(t){return fe.test(t)||pe(t)!==null}function et(t,e){for(let n=1;n<e;n++)if(z(t.slice(n)))return!0;return!1}var tt=/^([\w-]+)@\s*(?=(?:<)?(?:~{3,}|-\.+->|-\.+-|={2,}>|={3,}|o-{2,}[ox]|x-{2,}[ox]|-{2,}[ox]|-{2,}>|-{3,}|(?:-{2,}|-\.+|={2,})\s+))/;function j(t){let e=P(t);if(!e)return null;let n=t.slice(3),r=e.className.length,s=r;for(let o=1;o<r;o++)if(z(n.slice(o))){s=o;break}return{className:n.slice(0,s),length:3+s}}function nt(t,e,n,r=new Set){let s=t.trim().replace(/;\s*$/,"").trim(),o=le(s,e,n,r);if(!o||o.ids.length===0)return{ok:!1,remaining:s,reason:"expected node"};s=o.remaining.trim();let i=o.ids;for(;s.length>0;){let a,l,u,d,c,f,y,w=s.match(tt),p=w?.[1];w&&(s=s.slice(w[0].length).trim());let S=s.match(fe);if(S){let h=S[2],M=S[0].length,L=s.slice(M);if(L.startsWith("|")){let k=Xe(L);if(!k)return{ok:!1,remaining:L,reason:"expected edge target"};let N=k.rawLabel.trim();f=N?$(N).text:void 0,M+=k.consumed}s=s.slice(M).trim(),l=at(h),y=ct(h),d=dt(h,!!S[1]),c=ge(h),a=d!==void 0,u=c!==void 0}else{let h=pe(s);if(!h)return{ok:!1,remaining:s,reason:"expected edge operator"};a=h.hasArrowStart,f=$(h.rawLabel).text,s=s.slice(h.consumed).trim(),l=be(h.openOp,h.closeOp),y=lt(h.openOp,h.closeOp),d=a?"arrow":void 0,c=ge(h.closeOp),u=c!==void 0}let m=le(s,e,n,r);if(!m||m.ids.length===0)return{ok:!1,remaining:s,reason:"expected edge target"};s=m.remaining.trim();for(let h of i)for(let M of m.ids)e.edges.push({source:h,target:M,...p!==void 0?{id:p}:{},label:f,style:l,hasArrowStart:a,hasArrowEnd:u,startMarker:d,endMarker:c,...y!==void 0?{length:y}:{}});i=m.ids}return{ok:!0}}function le(t,e,n,r){let s=ue(t,e,n,r);if(!s)return null;let o=[s.id],i=s.remaining.trim();for(;i.startsWith("&");){i=i.slice(1).trim();let a=ue(i,e,n,r);if(!a)break;o.push(a.id),i=a.remaining.trim()}return{ids:o,remaining:i}}function rt(t,e,n){let r=t.match(new RegExp(`^(${D})@\\s*\\{`,"u"));if(!r)return null;let s=r[1],o=t.indexOf("{",r[0].indexOf("@")),i=me(t,o);return i<0?null:(he(s,t.slice(o+1,i),e,n),{id:s,remaining:t.slice(i+1)})}function he(t,e,n,r){let s=B(e),o=s.get("label"),i=o!==void 0?$(o,!0):void 0,a=s.get("shape"),l=a!==void 0?X(a):null,u=C(s.get("icon")),d=C(s.get("img")),c=C(s.get("form")),f=c==="circle"||c==="rounded"||c==="square"?c:void 0,y=l?{shape:l.geometry,semanticShape:l.canonical,authoredShape:a.trim()}:u||d?{shape:f==="circle"?"circle":f==="rounded"?"rounded":"rectangle",semanticShape:u?"icon":"image"}:{},w={...u?{icon:u}:{},...d?{image:d}:{},...f?{iconForm:f}:{}},p=n.nodes.get(t);p?(n.nodes.set(t,{...p,...i!==void 0?{label:i.text,...i.markdown?{markdownLabel:!0}:{}}:{},...y,...w}),ye(r,t)):v(n,r,{id:t,label:i?.text??t,shape:"rectangle",...i?.markdown?{markdownLabel:!0}:{},...y,...w})}function de(t,e,n,r){if(!e.match(/^@\s*\{/))return null;let o=e.indexOf("{"),i=me(e,o);return i<0?null:(he(t,e.slice(o+1,i),n,r),e.slice(i+1))}function me(t,e){if(e<0||t[e]!=="{")return-1;let n=0,r=null,s=!1;for(let o=e;o<t.length;o++){let i=t[o];if(s){s=!1;continue}if(i==="\\"){s=!0;continue}if(r){i===r&&(r=null);continue}if(i==='"'||i==="'"){r=i;continue}if(i==="{")n++;else if(i==="}"&&(n--,n===0))return o}return-1}function B(t){let e="",n=null,r=!1;for(let l of t){if(r){r=!1,e+=" ";continue}if(l==="\\"){e+=" ",r=!0;continue}if(n){l===n&&(n=null),e+=" ";continue}if(l==='"'||l==="'"){n=l,e+=" ";continue}e+=l}let s=/(^|[,\s])([\w-]+)\s*:/g,o=[],i;for(;(i=s.exec(e))!==null;)o.push({key:i[2].toLowerCase(),keyStart:i.index+i[1].length,valueStart:i.index+i[0].length});let a=new Map;for(let l=0;l<o.length;l++){let u=l+1<o.length?o[l+1].keyStart:t.length,d=t.slice(o[l].valueStart,u).trim().replace(/,\s*$/,"").trim();a.set(o[l].key,st(d))}return a}function st(t){return t.length>=2&&(t.startsWith('"')&&t.endsWith('"')||t.startsWith("'")&&t.endsWith("'"))?t.slice(1,-1).replace(/\\([\\"'])/g,"$1"):t}var it=[{open:"(((",close:")))",shape:"doublecircle"},{open:"([",close:"])",shape:"stadium"},{open:"((",close:"))",shape:"circle"},{open:"[[",close:"]]",shape:"subroutine"},{open:"[(",close:")]",shape:"cylinder"},{open:"[/",close:"\\]",shape:"trapezoid"},{open:"[\\",close:"/]",shape:"trapezoid-alt"},{open:"[/",close:"/]",shape:"lean-r"},{open:"[\\",close:"\\]",shape:"lean-l"},{open:">",close:"]",shape:"asymmetric"},{open:"{{",close:"}}",shape:"hexagon"},{open:"[",close:"]",shape:"rectangle"},{open:"(",close:")",shape:"rounded"},{open:"{",close:"}",shape:"diamond"}];function ot(t,e,n){let r=F(t);if(!r)return null;let s=t.slice(r.length);for(let o of it){if(!s.startsWith(`${o.open}"`))continue;let i=o.open.length,a=-1,l=!1;for(let f=i+1;f<s.length;f++){let y=s[f];if(l){l=!1;continue}if(y==="\\"){l=!0;continue}if(y==='"'){a=f;break}}if(a<0||!s.startsWith(o.close,a+1))continue;let u=s.slice(i+1,a).replace(/\\(["\\])/g,"$1"),d=$(u,!0);v(e,n,{id:r.id,label:d.text,shape:o.shape,...d.markdown?{markdownLabel:!0}:{}});let c=r.length+a+1+o.close.length;return{id:r.id,remaining:t.slice(c)}}return null}function ue(t,e,n,r){let s=rt(t,e,n);if(s){let u=s.remaining,d=j(u);return d&&(e.classAssignments.set(s.id,d.className),u=u.slice(d.length)),{id:s.id,remaining:u}}let o=ot(t,e,n);if(o){let u=de(o.id,o.remaining,e,n)??o.remaining,d=j(u);return d&&(e.classAssignments.set(o.id,d.className),u=u.slice(d.length)),{id:o.id,remaining:u}}let i=null,a=t;for(let{regex:u,shape:d}of Ke){let c=t.match(u);if(c){if(et(t,c[1].length))continue;i=c[1];let{text:f,markdown:y}=$(c[2]);v(e,n,{id:i,label:f,shape:d,...y?{markdownLabel:!0}:{}}),a=t.slice(c[0].length);break}}if(i===null){let u=Ze(t);u&&(i=u.id,!e.nodes.has(i)&&!r.has(i)&&v(e,n,{id:i,label:i,shape:"rectangle"}),a=t.slice(u.length))}if(i===null)return null;a=de(i,a,e,n)??a;let l=j(a);return l&&(e.classAssignments.set(i,l.className),a=a.slice(l.length)),{id:i,remaining:a}}function v(t,e,n){!t.nodes.has(n.id)&&t.nodes.set(n.id,n),ye(e,n.id)}function ye(t,e){if(t.length>0){let n=t[t.length-1];n.nodeIds.includes(e)||n.nodeIds.push(e)}}function at(t){return t[0]==="~"?"invisible":t.includes(".")?"dotted":t.includes("=")?"thick":"solid"}function ct(t){let e;if(t[0]==="~")e=t.length-3;else if(t.includes("."))e=(t.match(/\./g)?.length??1)-1;else if(t.includes("=")){let n=t.match(/=/g)?.length??2;e=t.endsWith(">")?n-2:n-3}else{let n=t.match(/-/g)?.length??2;e=/[>ox]$/.test(t)||/^[ox]/.test(t)?n-2:n-3}return e>0?e+1:void 0}function be(t,e){return t.includes(".")||e.includes(".")?"dotted":t.includes("=")||e.includes("=")?"thick":"solid"}function lt(t,e){let n=be(t,e),r=(a,l)=>(a.match(new RegExp(`\\${l}`,"g"))??[]).length,s=0,o=0;n==="dotted"?(s=Math.max(0,r(t,".")-1),o=Math.max(0,r(e,".")-1)):n==="thick"?(s=Math.max(0,r(t,"=")-2),o=Math.max(0,r(e,"=")-(e.endsWith(">")?2:3))):(s=Math.max(0,r(t,"-")-2),o=Math.max(0,r(e,"-")-(e.endsWith(">")?2:3)));let i=Math.max(s,o);return i>0?i+1:void 0}function dt(t,e){if(e)return"arrow";if(t.startsWith("o"))return"circle";if(t.startsWith("x"))return"cross"}function ge(t){let e=t[t.length-1];if(e===">")return"arrow";if(e==="o")return"circle";if(e==="x")return"cross"}export{Nt as a};
@@ -0,0 +1,11 @@
1
+ import{a as ne}from"./chunk-5Q4S74UO.js";import{g as I}from"./chunk-PXRUFH7U.js";import{a as q}from"./chunk-M6BT2HIP.js";import{e as A,g as R,h as W,j as L,k as N}from"./chunk-RVO6J7S3.js";import{G as Q,H as O,I as G,N as X,O as p,P as z,Q as K,ea as U,fa as Y,i as E,ia as C,ja as T,ka as P,la as _,na as J,oa as ee,pa as v,qa as te,v as V,xa as re,y as Z,z as B}from"./chunk-FXBBGAMJ.js";function Je(e){let{positioned:s,colors:n,resolved:o}=e,t=o.renderOptions,r=n.font??"Inter",i=t.transparent??!1,$=[],c=o.familyAppearance?.visual??t.stateVisual,a=N(t,c?.styleDefaults,o.styleFace);$.push(te({id:"prelude",width:s.width,height:s.height,colors:n,transparent:i,font:r,hasMonoFont:!1},G(s.width,s.height,n,i)+`
2
+ `+O(r,!1,n.shadow,n.embedFontImport)));let d=[];d.push("<defs>");let l=Q(n);l&&d.push(l);let h=new Set;a.edgeStrokeColor&&h.add(a.edgeStrokeColor);let u=!1,f=!1;for(let m of s.edges)m.inlineStyle?.stroke&&h.add(m.inlineStyle.stroke),(m.startMarker==="circle"||m.endMarker==="circle")&&(u=!0),(m.startMarker==="cross"||m.endMarker==="cross")&&(f=!0);let g=pe(h,u,f);d.splice(1,0,re(g)),d.push("</defs>"),$.push(J({id:"defs",markerResources:g},d.join(`
3
+ `)));for(let m of s.groups)$.push(j(m,r,a));let x=new Map,S=new Map;for(let m of s.edges){if(m.points.length<2)continue;let y=`${m.source}->${m.target}`,k=x.get(y)??0;x.set(y,k+1);let b=`edge:${y}#${k}`;S.set(m,b),$.push(fe(m,a,b,g))}for(let m of s.edges){let y=S.get(m);m.label&&y&&$.push(ke(m,r,a,he(y)))}for(let m of s.nodes)$.push(be(m,r,a,t.security!=="strict"));for(let m of s.notes??[])$.push(ge(m,r,a));return $.push(ee()),{family:"flowchart",width:s.width,height:s.height,colors:n,transparent:i,parts:$}}function oe(e){let s=R.width,n=R.height,o=s-1,t=e??"var(--_arrow)",r=e?`-${H(e)}`:"",i={fill:t,stroke:t,strokeWidth:"0.75",strokeLinejoin:"round"};return[{id:`arrowhead${r}`,shape:"arrow",size:{width:s,height:n},ref:{x:o,y:n/2},orient:"auto",geometry:{kind:"polygon",points:[{x:0,y:0},{x:s,y:n/2},{x:0,y:n}]},paint:i},{id:`arrowhead-start${r}`,shape:"arrow",size:{width:s,height:n},ref:{x:1,y:n/2},orient:"auto",geometry:{kind:"polygon",points:[{x:s,y:0},{x:0,y:n/2},{x:s,y:n}]},paint:i}]}function ie(e){let s=R.width,n=e?`-${H(e)}`:"",o=e??"var(--_arrow)",t=s/2-.75,r={shape:"circle",size:{width:s,height:s},orient:"auto",geometry:{kind:"circle",cx:s/2,cy:s/2,r:t},paint:{fill:"none",stroke:o,strokeWidth:"1"}};return[{...r,id:`circlehead${n}`,ref:{x:s-.5,y:s/2}},{...r,id:`circlehead-start${n}`,ref:{x:.5,y:s/2}}]}function se(e){let s=R.width,n=e?`-${H(e)}`:"",o=e??"var(--_arrow)",t=1.25,r=t,i=s-t,$={shape:"cross",size:{width:s,height:s},orient:"auto",geometry:{kind:"compound",children:[{kind:"line",x1:r,y1:r,x2:i,y2:i},{kind:"line",x1:r,y1:i,x2:i,y2:r}]},paint:{stroke:o,strokeWidth:"1.25",strokeLinecap:"round"}};return[{...$,id:`crosshead${n}`,ref:{x:i,y:s/2}},{...$,id:`crosshead-start${n}`,ref:{x:t,y:s/2}}]}function pe(e,s,n){let o=[...oe()];s&&o.push(...ie()),n&&o.push(...se());for(let t of e)o.push(...oe(t)),s&&o.push(...ie(t)),n&&o.push(...se(t));return o}function ae(e){return e==="circle"?"circlehead":e==="cross"?"crosshead":"arrowhead"}function H(e){return e.replace(/[^a-zA-Z0-9]/g,s=>s.charCodeAt(0).toString(16))}function j(e,s,n,o){if(e.concurrencyRegion)return v({id:`group:${e.id}`,role:"group",open:`<g class="concurrency-region" data-id="${p(e.id)}"${o?` data-parent-id="${p(o)}"`:""}>`,close:"</g>",children:e.children.map(u=>({indent:0,node:j(u,s,n,e.id)}))});let t=n.groupHeaderFontSize+16,r=[],i=`<g class="subgraph" data-id="${p(e.id)}" data-region="subgraph" data-label="${p(e.label)}"${o?` data-parent-id="${p(o)}"`:""}>`,$=n.groupFillColor??"var(--_group-fill)",c=n.groupBorderColor??"var(--_node-stroke)";r.push({indent:2,node:C({id:`group-rect:${e.id}`,role:"group",geometry:{kind:"rect",x:e.x,y:e.y,width:e.width,height:e.height,rx:n.groupCornerRadius,ry:n.groupCornerRadius},paint:{fill:$,stroke:c,strokeWidth:String(n.groupLineWidth)}},`<rect x="${e.x}" y="${e.y}" width="${e.width}" height="${e.height}" rx="${n.groupCornerRadius}" ry="${n.groupCornerRadius}" fill="${p($)}" stroke="${p(c)}" stroke-width="${n.groupLineWidth}" />`)});let a=n.groupHeaderFillColor??"var(--_group-hdr)",d=q(e.x,e.y,e.width,t,n.groupCornerRadius);r.push({indent:2,node:C({id:`group-header:${e.id}`,role:"group-header",geometry:{kind:"path",d},paint:{fill:a,stroke:c,strokeWidth:String(n.groupLineWidth)}},`<path d="${d}" fill="${p(a)}" stroke="${p(c)}" stroke-width="${n.groupLineWidth}" />`)});let l=L(e.label,n.groupTextTransform),h=n.groupTextColor??"var(--_text-sec)";r.push({indent:2,node:P({id:`group-label:${e.id}`,role:"group-header",text:l,x:e.x+n.groupLabelPaddingX,y:e.y+t/2,fontSize:n.groupHeaderFontSize,anchor:"start",paint:{fill:h}},z(l,e.x+n.groupLabelPaddingX,e.y+t/2,n.groupHeaderFontSize,`font-size="${n.groupHeaderFontSize}" font-weight="${n.groupHeaderFontWeight}"${n.groupFont?` font-family="${p(n.groupFont)}"`:""}${n.groupLetterSpacing!==0?` letter-spacing="${n.groupLetterSpacing}"`:""} fill="${p(h)}"`))});for(let u of me(e,t))r.push({indent:2,node:C({id:`region-separator:${e.id}:${u.index}`,role:"group",geometry:{kind:"line",x1:u.x1,y1:u.y1,x2:u.x2,y2:u.y2},paint:{stroke:c,strokeWidth:String(n.groupLineWidth),strokeDasharray:"6 4"}},`<line class="region-separator" x1="${u.x1}" y1="${u.y1}" x2="${u.x2}" y2="${u.y2}" stroke="${p(c)}" stroke-width="${n.groupLineWidth}" stroke-dasharray="6 4" />`)});for(let u of e.children)r.push({indent:0,node:j(u,s,n,e.id)});return v({id:`group:${e.id}`,role:"group",open:i,close:"</g>",children:r})}function me(e,s){let n=e.children.filter(c=>c.concurrencyRegion);if(n.length<2)return[];let o=c=>Math.max(...n.map(c))-Math.min(...n.map(c)),t=o(c=>c.x+c.width/2)>=o(c=>c.y+c.height/2),r=[...n].sort((c,a)=>t?c.x-a.x:c.y-a.y),i=4,$=[];for(let c=1;c<r.length;c++){let a=r[c-1],d=r[c];if(t){let l=(a.x+a.width+d.x)/2;$.push({index:c-1,x1:l,y1:e.y+s+i,x2:l,y2:e.y+e.height-i})}else{let l=(a.y+a.height+d.y)/2;$.push({index:c-1,x1:e.x+i,y1:l,x2:e.x+e.width-i,y2:l})}}return $}function ge(e,s,n){let{x:o,y:t,width:r,height:i}=e,$=n.groupHeaderFillColor??"var(--_group-hdr)",c=n.groupBorderColor??"var(--_node-stroke)",a=n.edgeTextColor??"var(--_text-sec)",d=L(e.text,n.nodeTextTransform),l=`state-note:${e.id}`;return v({id:l,role:"note",open:`<g class="state-note" data-id="${p(e.id)}" data-target="${p(e.target)}" data-side="${e.side}">`,close:"</g>",children:[{indent:2,node:C({id:`${l}:rect`,role:"note",geometry:{kind:"rect",x:o,y:t,width:r,height:i,rx:4,ry:4},paint:{fill:$,stroke:c,strokeWidth:String(A.innerBox)}},`<rect x="${o}" y="${t}" width="${r}" height="${i}" rx="4" ry="4" fill="${p($)}" stroke="${p(c)}" stroke-width="${A.innerBox}" />`)},{indent:2,node:P({id:`${l}:text`,role:"label",text:d,x:o+r/2,y:t+i/2,fontSize:n.edgeLabelFontSize,anchor:"middle",paint:{fill:a}},z(d,o+r/2,t+i/2,n.edgeLabelFontSize,`text-anchor="middle" font-size="${n.edgeLabelFontSize}" font-weight="${n.edgeLabelFontWeight}"${n.edgeLetterSpacing!==0?` letter-spacing="${n.edgeLetterSpacing}"`:""} fill="${p(a)}"`))}]})}function fe(e,s,n,o){let t=e.style==="dotted"?"dotted":e.style==="thick"?"thick":e.style==="invisible"?"invisible":"solid",r=he(n),i=e.labelPosition??ue(e.points),$=s.edgeTextColor??"var(--_text-sec)",c=e.label?[{id:`${n}:label`,text:e.label,anchor:i,paint:{fill:$},fontSize:s.edgeLabelFontSize,textAnchor:"middle",visual:{kind:"companion",markId:`${r}:text`}}]:[],a={identity:{id:e.id??n},endpoints:{from:e.source,to:e.target},relationship:{kind:"flowchart-edge",direction:e.source===e.target?"self":e.hasArrowStart&&e.hasArrowEnd?"bidirectional":e.hasArrowStart?"reverse":e.hasArrowEnd?"forward":"undirected"},route:{ownership:"layout",bendRadius:s.edgeBendRadius,labelAnchors:e.labelPosition?[e.labelPosition]:[]},labels:c};if(e.style==="invisible")return T({id:n,role:"edge",geometry:{kind:"polyline",points:e.points},lineStyle:"invisible",paint:{},...a},"");let d=e.curve?xe(e.points):s.edgeBendRadius>0?Y(e.points,s.edgeBendRadius,{precision:3}):void 0,l=d?.geometry.d??ye(e.points),h=e.style==="dotted"?`${W.dash} ${W.gap}`:e.animate?"8 4":void 0,u=h?` stroke-dasharray="${h}"`:"",f=e.style==="thick"?s.lineWidth*2:s.lineWidth,g=e.inlineStyle?.stroke??s.edgeStrokeColor,x=p(g??"var(--_line)"),S=p(e.inlineStyle?.["stroke-width"]??String(f)),m=g?`-${H(g)}`:"",y="",k,b;if(e.hasArrowEnd){let M=ae(e.endMarker??"arrow");if(k=o.find(F=>F.id===`${M}${m}`),!k)throw new Error(`Missing marker resource "${M}${m}"`);y+=` marker-end="url(#${M}${m})"`}if(e.hasArrowStart){let M=ae(e.startMarker??"arrow");if(b=o.find(F=>F.id===`${M}-start${m}`),!b)throw new Error(`Missing marker resource "${M}-start${m}"`);y+=` marker-start="url(#${M}-start${m})"`}let w=['class="edge"',...e.id?[`data-id="${p(e.id)}"`]:[],`data-from="${p(e.source)}"`,`data-to="${p(e.target)}"`,`data-style="${e.style}"`,`data-arrow-start="${e.hasArrowStart}"`,`data-arrow-end="${e.hasArrowEnd}"`];e.hasArrowStart&&w.push(`data-marker-start="${e.startMarker??"arrow"}"`),e.hasArrowEnd&&w.push(`data-marker-end="${e.endMarker??"arrow"}"`),e.label&&w.push(`data-label="${p(e.label)}"`),e.curve&&w.push(`data-curve="${p(e.curve)}"`),e.animate&&w.push('data-animate="true"',`data-animation="${e.animation??"slow"}"`);let D={stroke:g??"var(--_line)",strokeWidth:e.inlineStyle?.["stroke-width"]??String(f),...h?{strokeDasharray:h}:{}};if(s.edgeBendRadius>0||e.curve){if(!d)throw new Error(`Missing path projection for flowchart edge "${n}"`);return T({id:n,role:"edge",geometry:d.geometry,lineStyle:t,paint:D,markers:{...b?{start:b}:{},mid:[],...k?{end:k}:{}},...a,route:{...a.route,contours:d.contours}},`<path ${w.join(" ")} d="${l}" fill="none" stroke="${x}" stroke-width="${S}"${u}${y} />`)}return T({id:n,role:"edge",geometry:{kind:"polyline",points:e.points},lineStyle:t,paint:D,markers:{...b?{start:b}:{},mid:[],...k?{end:k}:{}},...a},`<polyline ${w.join(" ")} points="${l}" fill="none" stroke="${x}" stroke-width="${S}"${u}${y} />`)}function he(e){return e.startsWith("edge:")?`edge-label:${e.slice(5)}`:`${e}:label`}function xe(e){let s=e[0],n=`M ${s.x} ${s.y}`,o=[];for(let t=1;t<e.length;t++){let r=e[t-1],i=e[t],$=(r.x+i.x)/2;n+=` C ${$} ${r.y}, ${$} ${i.y}, ${i.x} ${i.y}`,o.push({kind:"cubic",control1:{x:$,y:r.y},control2:{x:$,y:i.y},end:i})}return U(n,s,o)}function ye(e){return e.map(s=>`${s.x},${s.y}`).join(" ")}function et(e){let s=/<((?:[A-Za-z_][\w.-]*:)?(?:style|text|title|desc|metadata))\b[\s\S]*?<\/\1>/gi,n=[],o=0,t;for(;(t=s.exec(e))!==null;)t.index>o&&n.push({kind:"plain",text:e.slice(o,t.index)}),n.push({kind:"protected",text:t[0]}),o=t.index+t[0].length;return o<e.length&&n.push({kind:"plain",text:e.slice(o)}),n.map(r=>r.kind==="protected"?r.text:r.text.replace(/>\s*\r?\n\s*</g,"><")).join("")}function tt(e,s){if(!/^[A-Za-z0-9_.:-]+$/.test(s))throw new Error("idPrefix must be non-empty and contain only ASCII letters, digits, underscore, hyphen, dot, and colon");let n=new Set;for(let r of V(e))for(let i of r.attributes)i.name==="id"&&n.add(i.value);let o=r=>r.startsWith(s)?r:`${s}${r}`,t=Z(e,r=>{if(r.name==="id")return o(r.value);if(r.name==="aria-labelledby"||r.name==="aria-describedby")return r.value.split(/\s+/).map(i=>n.has(i)?o(i):i).join(" ");if((r.name==="href"||r.name==="xlink:href")&&r.value.startsWith("#")){let i=r.value.slice(1);return n.has(i)?`#${o(i)}`:r.value}});return B(t,r=>r.replace(/url\(#([^)]+)\)/g,(i,$)=>n.has($)?`url(#${o($)})`:i))}function ke(e,s,n,o){let t=e.labelPosition??ue(e.points),r=L(e.label,n.edgeTextTransform),i=8,$=e.style==="thick"?n.lineWidth*2:n.lineWidth,c=i+Math.max(4,$*2),a=E(r,n.edgeLabelFontSize,n.edgeLabelFontWeight),d=a.width+c*2,l=a.height+c*2,h=t.x-d/2,u=t.y-l/2,f=C({id:`${o}:halo`,role:"chrome",geometry:{kind:"rect",x:h,y:u,width:d,height:l,rx:4,ry:4},paint:{fill:"var(--bg)",stroke:"none"}},`<rect class="edge-label-halo" x="${h}" y="${u}" width="${d}" height="${l}" rx="4" ry="4" fill="var(--bg)" stroke="none" />`),g=n.edgeTextColor??"var(--_text-sec)",x=P({id:`${o}:text`,role:"label",text:r,x:t.x,y:t.y,fontSize:n.edgeLabelFontSize,anchor:"middle",paint:{fill:g}},K(r,t.x,t.y,a.width,a.height,n.edgeLabelFontSize,i,`text-anchor="middle" font-size="${n.edgeLabelFontSize}" font-weight="${n.edgeLabelFontWeight}"${n.edgeLetterSpacing!==0?` letter-spacing="${n.edgeLetterSpacing}"`:""} fill="${p(g)}"`,'rx="2" ry="2" fill="var(--bg)" stroke="var(--_inner-stroke)" stroke-width="1"'));return v({id:o,role:"edge-label",open:`<g class="edge-label" data-from="${p(e.source)}" data-to="${p(e.target)}" data-label="${p(e.label)}">`,close:"</g>",children:[{indent:2,node:f},{indent:2,node:x}]})}function ue(e){if(e.length===0)return{x:0,y:0};if(e.length===1)return e[0];let s=0;for(let o=1;o<e.length;o++)s+=ce(e[o-1],e[o]);let n=s/2;for(let o=1;o<e.length;o++){let t=ce(e[o-1],e[o]);if(n<=t){let r=n/t;return{x:e[o-1].x+r*(e[o].x-e[o-1].x),y:e[o-1].y+r*(e[o].y-e[o-1].y)}}n-=t}return e[e.length-1]}function ce(e,s){return Math.sqrt((s.x-e.x)**2+(s.y-e.y)**2)}function be(e,s,n,o){let t=Me(e,n),r=Ee(e,s,n),$=["node",...(e.classNames??[]).map(u=>u.replace(/[^A-Za-z0-9_-]/g,"")).filter(Boolean)].join(" "),c=e.shape==="state-start"?{status:"start"}:e.shape==="state-end"?{status:"end"}:void 0,a=[{indent:2,node:t}],d=we(e,n);d&&a.push({indent:2,node:d}),r&&a.push({indent:2,node:r});let l=e.semanticShape?` data-semantic-shape="${p(e.semanticShape)}"`:"",h=o&&e.href?` data-href="${p(e.href)}" role="link" tabindex="0"`:"";return v({id:`node:${e.id}`,role:"node",open:`<g class="${$}" data-id="${p(e.id)}" data-label="${p(e.label)}" data-shape="${e.shape}"${l}${h}>`,close:"</g>",children:a,channels:c})}function Se(e,s,n,o){let{x:t,y:r,width:i,height:$}=e,c=t+i,a=r+$,d=t+i/2,l=r+$/2,h=(f,g="")=>({geometry:{kind:"path",d:f},crisp:`<path d="${f}" fill="${g.includes('fill="none"')?"none":s}" stroke="${n}" stroke-width="${o}" />`}),u=f=>({geometry:{kind:"polygon",points:f},crisp:`<polygon points="${f.map(g=>`${g.x},${g.y}`).join(" ")}" fill="${s}" stroke="${n}" stroke-width="${o}" />`});switch(e.semanticShape){case"bang":{let f=Array.from({length:16},(g,x)=>{let S=-Math.PI/2+x*Math.PI/8,m=x%2===0?1:.62;return{x:d+Math.cos(S)*i/2*m,y:l+Math.sin(S)*$/2*m}});return u(f)}case"notch-rect":return u([{x:t+10,y:r},{x:c,y:r},{x:c,y:a},{x:t,y:a},{x:t,y:r+10}]);case"cloud":return h(`M${t+i*.18} ${a}C${t-4} ${a} ${t-4} ${l} ${t+i*.12} ${l}C${t+i*.08} ${r+$*.15} ${t+i*.38} ${r-4} ${t+i*.48} ${r+$*.18}C${t+i*.65} ${r-5} ${c} ${r+$*.16} ${t+i*.88} ${l}C${c+5} ${l} ${c+5} ${a} ${t+i*.72} ${a}Z`);case"hourglass":return u([{x:t,y:r},{x:c,y:r},{x:t+i*.62,y:l},{x:c,y:a},{x:t,y:a},{x:t+i*.38,y:l}]);case"bolt":return u([{x:t+i*.55,y:r},{x:t+i*.25,y:l},{x:t+i*.48,y:l},{x:t+i*.35,y:a},{x:t+i*.78,y:r+$*.4},{x:t+i*.55,y:r+$*.4}]);case"brace":return h(`M${c} ${r}C${t+i*.4} ${r} ${t+i*.7} ${l} ${t} ${l}C${t+i*.7} ${l} ${t+i*.4} ${a} ${c} ${a}`,' fill="none"');case"brace-r":return h(`M${t} ${r}C${t+i*.6} ${r} ${t+i*.3} ${l} ${c} ${l}C${t+i*.3} ${l} ${t+i*.6} ${a} ${t} ${a}`,' fill="none"');case"braces":return h(`M${t+i*.25} ${r}C${t} ${r} ${t+i*.15} ${l} ${t} ${l}C${t+i*.15} ${l} ${t} ${a} ${t+i*.25} ${a}M${t+i*.75} ${r}C${c} ${r} ${t+i*.85} ${l} ${c} ${l}C${t+i*.85} ${l} ${c} ${a} ${t+i*.75} ${a}`,' fill="none"');case"datastore":return h(`M${t+8} ${r}H${c}V${a}H${t+8}M${t+8} ${r}C${t-2} ${r+$*.2} ${t-2} ${a-$*.2} ${t+8} ${a}`,' fill="none"');case"delay":return h(`M${t} ${r}H${c-$/2}A${$/2} ${$/2} 0 0 1 ${c-$/2} ${a}H${t}Z`);case"h-cyl":return h(`M${t+10} ${r}H${c-10}A10 ${$/2} 0 0 1 ${c-10} ${a}H${t+10}A10 ${$/2} 0 0 1 ${t+10} ${r}Z M${c-10} ${r}A10 ${$/2} 0 0 0 ${c-10} ${a}`);case"lin-cyl":return h(`M${t} ${r+8}A${i/2} 8 0 0 1 ${c} ${r+8}V${a-8}A${i/2} 8 0 0 1 ${t} ${a-8}Z M${t} ${r+8}A${i/2} 8 0 0 0 ${c} ${r+8}M${t} ${a-16}A${i/2} 8 0 0 0 ${c} ${a-16}`);case"curv-trap":return h(`M${t+12} ${r}Q${d} ${r+8} ${c-12} ${r}L${c} ${a}Q${d} ${a-8} ${t} ${a}Z`);case"div-rect":return h(`M${t} ${r}H${c}V${a}H${t}ZM${t} ${l}H${c}`);case"doc":return h(`M${t} ${r}H${c}V${a-8}Q${t+i*.75} ${a+2} ${d} ${a-8}Q${t+i*.25} ${a-18} ${t} ${a-8}Z`);case"tri":return u([{x:d,y:r},{x:c,y:a},{x:t,y:a}]);case"fork":return{geometry:{kind:"rect",x:t,y:l-4,width:i,height:8},crisp:`<rect x="${t}" y="${l-4}" width="${i}" height="8" fill="${n}" stroke="${n}" stroke-width="${o}" />`};case"win-pane":return h(`M${t} ${r}H${c}V${a}H${t}ZM${t+i*.28} ${r}V${a}M${t} ${r+$*.32}H${c}`);case"f-circ":return{geometry:{kind:"circle",cx:d,cy:l,r:Math.min(i,$)/2},crisp:`<circle cx="${d}" cy="${l}" r="${Math.min(i,$)/2}" fill="${n}" stroke="${n}" stroke-width="${o}" />`};case"lin-doc":return h(`M${t} ${r}H${c}V${a-8}Q${t+i*.75} ${a+2} ${d} ${a-8}Q${t+i*.25} ${a-18} ${t} ${a-8}ZM${t+8} ${r+8}H${c-8}`);case"lin-rect":return h(`M${t} ${r}H${c}V${a}H${t}ZM${t+6} ${r}V${a}M${c-6} ${r}V${a}`);case"notch-pent":return u([{x:t,y:r},{x:c-10,y:r},{x:c,y:l},{x:c-10,y:a},{x:t,y:a},{x:t+8,y:l}]);case"flip-tri":return u([{x:t,y:r},{x:c,y:r},{x:d,y:a}]);case"docs":return h(`M${t+8} ${r}H${c}V${a-8}Q${t+i*.7} ${a} ${t+i*.45} ${a-8}Q${t+i*.22} ${a-16} ${t+8} ${a-8}ZM${t} ${r+8}H${t+8}M${t} ${r+8}V${a}`);case"st-rect":return h(`M${t+8} ${r}H${c}V${a-8}H${t+8}ZM${t} ${r+8}H${c-8}V${a}H${t}Z`);case"flag":return h(`M${t} ${r+6}Q${t+i*.25} ${r-4} ${d} ${r+6}Q${t+i*.75} ${r+16} ${c} ${r+6}V${a-6}Q${t+i*.75} ${a+4} ${d} ${a-6}Q${t+i*.25} ${a-16} ${t} ${a-6}Z`);case"sm-circ":return{geometry:{kind:"circle",cx:d,cy:l,r:Math.min(i,$)*.22},crisp:`<circle cx="${d}" cy="${l}" r="${Math.min(i,$)*.22}" fill="${s}" stroke="${n}" stroke-width="${o}" />`};case"cross-circ":return h(`M${d} ${r}A${i/2} ${$/2} 0 1 1 ${d-.01} ${r}M${t+i*.28} ${r+$*.28}L${t+i*.72} ${r+$*.72}M${t+i*.72} ${r+$*.28}L${t+i*.28} ${r+$*.72}`);case"bow-rect":return h(`M${t} ${r}Q${t+12} ${l} ${t} ${a}H${c}Q${c-12} ${l} ${c} ${r}Z`);case"tag-doc":return h(`M${t+10} ${r}H${c}V${a-8}Q${t+i*.7} ${a} ${d} ${a-8}Q${t+i*.25} ${a-16} ${t} ${a-8}V${r+10}ZM${t} ${r+10}L${t+10} ${r}`);case"tag-rect":return u([{x:t+10,y:r},{x:c,y:r},{x:c,y:a},{x:t,y:a},{x:t,y:r+10}]);case"text":return{geometry:{kind:"path",d:`M${t} ${r}`},crisp:`<path d="M${t} ${r}" fill="none" stroke="none" />`};default:return null}}function we(e,s){let n=p(s.nodeTextColor??"var(--_text)"),o=Math.min(28,e.height*.4),t=e.x+e.width/2,r=e.y+6;if(e.icon){let i=ne(e.icon);if(i){let c=o/24,a=i.paths.map(d=>`<path d="${d}"/>`).join("");return _({id:`node:${e.id}:icon`,role:"icon"},`<g class="flowchart-icon" data-icon="${p(e.icon)}" transform="translate(${t-o/2} ${r}) scale(${c})" fill="${n}" stroke="${n}" stroke-width="0.8">${a}</g>`)}let $=e.icon.split(/[:/\s-]+/).filter(Boolean).at(-1)?.slice(0,2).toUpperCase()||"?";return P({id:`node:${e.id}:icon`,role:"icon",text:$,x:t,y:r+o/2,fontSize:10,anchor:"middle",paint:{fill:n}},`<text class="flowchart-icon-fallback" data-icon="${p(e.icon)}" x="${t}" y="${r+o/2}" text-anchor="middle" font-size="10" fill="${n}">${X($)}</text>`)}if(e.image){let i=t-o/2;return _({id:`node:${e.id}:image`,role:"icon"},`<g class="flowchart-image-placeholder" data-image-src="${p(e.image)}" fill="none" stroke="${n}" stroke-width="1.2"><rect x="${i}" y="${r}" width="${o}" height="${o*.72}" rx="2"/><circle cx="${i+o*.72}" cy="${r+o*.2}" r="${o*.08}"/><path d="M${i+2} ${r+o*.66}L${i+o*.36} ${r+o*.36}L${i+o*.52} ${r+o*.5}L${i+o*.7} ${r+o*.32}L${i+o-2} ${r+o*.66}"/></g>`)}return null}function Me(e,s){let{x:n,y:o,width:t,height:r,shape:i,inlineStyle:$}=e,c=$?.fill??s.nodeFillColor??"var(--_node-fill)",a=$?.stroke??s.nodeBorderColor??"var(--_node-stroke)",d=$?.["stroke-width"]??String(s.nodeLineWidth),l=p(c),h=p(a),u=p(d),f=(()=>{let x=Se(e,l,h,u);if(x)return x;switch(i){case"service":return $e(n,o,t,r,l,h,u,s.cornerRadius??0);case"diamond":return le(n,o,t,r,l,h,u);case"rounded":return Ce(n,o,t,r,l,h,u,s.cornerRadius??6);case"stadium":return Pe(n,o,t,r,l,h,u);case"circle":return de(n,o,t,r,l,h,u);case"subroutine":return ve(n,o,t,r,l,h,u,s.cornerRadius??0);case"doublecircle":return Re(n,o,t,r,l,h,u);case"hexagon":return Le(n,o,t,r,l,h,u);case"cylinder":return Ae(n,o,t,r,l,h,u);case"asymmetric":return ze(n,o,t,r,l,h,u);case"trapezoid":return Te(n,o,t,r,l,h,u);case"trapezoid-alt":return He(n,o,t,r,l,h,u);case"lean-r":return Fe(n,o,t,r,l,h,u);case"lean-l":return We(n,o,t,r,l,h,u);case"state-start":return _e(n,o,t,r);case"state-end":return je(n,o,t,r);case"state-fork":case"state-join":return De(n,o,t,r);case"state-choice":return le(n,o,t,r,l,h,u);case"state-history":return de(n,o,t,r,l,h,u);default:return $e(n,o,t,r,l,h,u,s.cornerRadius??0)}})(),g=i==="state-start"||i==="state-fork"||i==="state-join"?{fill:"var(--_text)",stroke:"none"}:i==="state-end"?{fill:"var(--_text)",stroke:"var(--_text)"}:{fill:c,stroke:a,strokeWidth:d};return C({id:`node-shape:${e.id}`,role:"node",geometry:f.geometry,paint:g},f.crisp)}function $e(e,s,n,o,t,r,i,$=0){return{geometry:{kind:"rect",x:e,y:s,width:n,height:o,rx:$,ry:$},crisp:`<rect x="${e}" y="${s}" width="${n}" height="${o}" rx="${$}" ry="${$}" fill="${t}" stroke="${r}" stroke-width="${i}" />`}}function Ce(e,s,n,o,t,r,i,$=6){return{geometry:{kind:"rect",x:e,y:s,width:n,height:o,rx:$,ry:$},crisp:`<rect x="${e}" y="${s}" width="${n}" height="${o}" rx="${$}" ry="${$}" fill="${t}" stroke="${r}" stroke-width="${i}" />`}}function Pe(e,s,n,o,t,r,i){let $=o/2;return{geometry:{kind:"rect",x:e,y:s,width:n,height:o,rx:$,ry:$},crisp:`<rect x="${e}" y="${s}" width="${n}" height="${o}" rx="${$}" ry="${$}" fill="${t}" stroke="${r}" stroke-width="${i}" />`}}function de(e,s,n,o,t,r,i){let $=e+n/2,c=s+o/2,a=Math.min(n,o)/2;return{geometry:{kind:"circle",cx:$,cy:c,r:a},crisp:`<circle cx="${$}" cy="${c}" r="${a}" fill="${t}" stroke="${r}" stroke-width="${i}" />`}}function le(e,s,n,o,t,r,i){let $=e+n/2,c=s+o/2,a=n/2,d=o/2,l=[{x:$,y:c-d},{x:$+a,y:c},{x:$,y:c+d},{x:$-a,y:c}],h=l.map(u=>`${u.x},${u.y}`).join(" ");return{geometry:{kind:"polygon",points:l},crisp:`<polygon points="${h}" fill="${t}" stroke="${r}" stroke-width="${i}" />`}}function ve(e,s,n,o,t,r,i,$=0){return{geometry:{kind:"compound",children:[{kind:"rect",x:e,y:s,width:n,height:o,rx:$,ry:$},{kind:"line",x1:e+8,y1:s,x2:e+8,y2:s+o},{kind:"line",x1:e+n-8,y1:s,x2:e+n-8,y2:s+o}]},crisp:`<rect x="${e}" y="${s}" width="${n}" height="${o}" rx="${$}" ry="${$}" fill="${t}" stroke="${r}" stroke-width="${i}" />
4
+ <line x1="${e+8}" y1="${s}" x2="${e+8}" y2="${s+o}" stroke="${r}" stroke-width="${i}" />
5
+ <line x1="${e+n-8}" y1="${s}" x2="${e+n-8}" y2="${s+o}" stroke="${r}" stroke-width="${i}" />`}}function Re(e,s,n,o,t,r,i){let $=e+n/2,c=s+o/2,a=Math.min(n,o)/2,d=a-5;return{geometry:{kind:"compound",children:[{kind:"circle",cx:$,cy:c,r:a},{kind:"circle",cx:$,cy:c,r:d}]},crisp:`<circle cx="${$}" cy="${c}" r="${a}" fill="${t}" stroke="${r}" stroke-width="${i}" />
6
+ <circle cx="${$}" cy="${c}" r="${d}" fill="${t}" stroke="${r}" stroke-width="${i}" />`}}function Le(e,s,n,o,t,r,i){let $=o/4,c=[{x:e+$,y:s},{x:e+n-$,y:s},{x:e+n,y:s+o/2},{x:e+n-$,y:s+o},{x:e+$,y:s+o},{x:e,y:s+o/2}],a=c.map(d=>`${d.x},${d.y}`).join(" ");return{geometry:{kind:"polygon",points:c},crisp:`<polygon points="${a}" fill="${t}" stroke="${r}" stroke-width="${i}" />`}}function Ae(e,s,n,o,t,r,i){let c=e+n/2,a=s+7,d=o-14;return{geometry:{kind:"compound",children:[{kind:"rect",x:e,y:a,width:n,height:d},{kind:"line",x1:e,y1:a,x2:e,y2:a+d},{kind:"line",x1:e+n,y1:a,x2:e+n,y2:a+d},{kind:"ellipse",cx:c,cy:s+o-7,rx:n/2,ry:7},{kind:"ellipse",cx:c,cy:a,rx:n/2,ry:7}]},crisp:`<rect x="${e}" y="${a}" width="${n}" height="${d}" fill="${t}" stroke="none" />
7
+ <line x1="${e}" y1="${a}" x2="${e}" y2="${a+d}" stroke="${r}" stroke-width="${i}" />
8
+ <line x1="${e+n}" y1="${a}" x2="${e+n}" y2="${a+d}" stroke="${r}" stroke-width="${i}" />
9
+ <ellipse cx="${c}" cy="${s+o-7}" rx="${n/2}" ry="7" fill="${t}" stroke="${r}" stroke-width="${i}" />
10
+ <ellipse cx="${c}" cy="${a}" rx="${n/2}" ry="7" fill="${t}" stroke="${r}" stroke-width="${i}" />`}}function ze(e,s,n,o,t,r,i){let c=[{x:e+12,y:s},{x:e+n,y:s},{x:e+n,y:s+o},{x:e+12,y:s+o},{x:e,y:s+o/2}],a=c.map(d=>`${d.x},${d.y}`).join(" ");return{geometry:{kind:"polygon",points:c},crisp:`<polygon points="${a}" fill="${t}" stroke="${r}" stroke-width="${i}" />`}}function Te(e,s,n,o,t,r,i){let $=n*.15,c=[{x:e+$,y:s},{x:e+n-$,y:s},{x:e+n,y:s+o},{x:e,y:s+o}],a=c.map(d=>`${d.x},${d.y}`).join(" ");return{geometry:{kind:"polygon",points:c},crisp:`<polygon points="${a}" fill="${t}" stroke="${r}" stroke-width="${i}" />`}}function He(e,s,n,o,t,r,i){let $=n*.15,c=[{x:e,y:s},{x:e+n,y:s},{x:e+n-$,y:s+o},{x:e+$,y:s+o}],a=c.map(d=>`${d.x},${d.y}`).join(" ");return{geometry:{kind:"polygon",points:c},crisp:`<polygon points="${a}" fill="${t}" stroke="${r}" stroke-width="${i}" />`}}function Fe(e,s,n,o,t,r,i){let $=n*.15,c=[{x:e+$,y:s},{x:e+n,y:s},{x:e+n-$,y:s+o},{x:e,y:s+o}],a=c.map(d=>`${d.x},${d.y}`).join(" ");return{geometry:{kind:"polygon",points:c},crisp:`<polygon points="${a}" fill="${t}" stroke="${r}" stroke-width="${i}" />`}}function We(e,s,n,o,t,r,i){let $=n*.15,c=[{x:e,y:s},{x:e+n-$,y:s},{x:e+n,y:s+o},{x:e+$,y:s+o}],a=c.map(d=>`${d.x},${d.y}`).join(" ");return{geometry:{kind:"polygon",points:c},crisp:`<polygon points="${a}" fill="${t}" stroke="${r}" stroke-width="${i}" />`}}function _e(e,s,n,o){let t=e+n/2,r=s+o/2,i=Math.min(n,o)/2-2;return{geometry:{kind:"circle",cx:t,cy:r,r:i},crisp:`<circle cx="${t}" cy="${r}" r="${i}" fill="var(--_text)" stroke="none" />`}}function je(e,s,n,o){let t=e+n/2,r=s+o/2,i=Math.min(n,o)/2-2,$=i-4;return{geometry:{kind:"compound",children:[{kind:"circle",cx:t,cy:r,r:i},{kind:"circle",cx:t,cy:r,r:$}]},crisp:`<circle cx="${t}" cy="${r}" r="${i}" fill="none" stroke="var(--_text)" stroke-width="${A.innerBox*2}" />
11
+ <circle cx="${t}" cy="${r}" r="${$}" fill="var(--_text)" stroke="none" />`}}function De(e,s,n,o){let t=Math.min(n,o)/2;return{geometry:{kind:"rect",x:e,y:s,width:n,height:o,rx:t,ry:t},crisp:`<rect x="${e}" y="${s}" width="${n}" height="${o}" rx="${t}" ry="${t}" fill="var(--_text)" stroke="none" />`}}function Ee(e,s,n){if((e.shape==="state-start"||e.shape==="state-end"||e.shape==="state-fork"||e.shape==="state-join"||e.shape==="state-choice")&&!e.label)return null;let o=e.x+e.width/2,t=e.y+e.height/2,r=I(e.inlineStyle,n.nodeTextColor??"var(--_text)"),i=p(r),$=L(e.label,n.nodeTextTransform);return P({id:`node-label:${e.id}`,role:"label",text:$,x:o,y:t,fontSize:n.nodeLabelFontSize,anchor:"middle",paint:{fill:r}},z($,o,t,n.nodeLabelFontSize,`text-anchor="middle" font-size="${n.nodeLabelFontSize}" font-weight="${n.nodeLabelFontWeight}"${n.nodeLetterSpacing!==0?` letter-spacing="${n.nodeLetterSpacing}"`:""} fill="${i}"`))}export{Je as a,et as b,tt as c};